Skip to content

rupinjairaj/preview-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link Preview

  • Generates a preview for any HTTP link

Preview response properties

  • URL
  • Title
  • Description
  • Domain

WIP preview response properties

  • Image URL

Sample usage in a Spring Boot app

import io.rupj.linkpreview.models.Preview;
import io.rupj.linkpreview.service.LinkPreview;

@SpringBootApplication(scanBasePackages = "io.rupj.linkpreview")
@RestController
public class PreviewController {

private final LinkPreview preview;

    PreviewController(LinkPreview preview) {
        this.preview = preview;
    }
    
    @GetMapping("/preview")
    public Preview preview(@RequestParam(name = "link", required = true) String link) {
        return preview.generateLinkPreview(link);
    }

}

License

MIT

Releases

No releases published

Packages

 
 
 

Languages