preview-rs

Crates.iopreview-rs
lib.rspreview-rs
version0.1.3
sourcesrc
created_at2022-09-05 17:40:33.213755
updated_at2022-09-11 12:30:56.530433
descriptionA (simple) crate for fetching preview metadata from shorturls and links
homepagehttps://github.com/oayomide/preview-rs
repositoryhttps://github.com/oayomide/preview-rs
max_upload_size
id658975
size48,078
Ayomide Onigbinde (OAyomide)

documentation

README

Preview-rs

A rust crate to fetch preview metadata for a URL.

Things left to be done:

  • More fallback options especially for images.
  • Support more multimedia options than images (video, png, etc).
  • Allow passing custom user-agent in the request.

Usage

    let prev = preview_rs::Preview::new("https://deezer.com");
    let preview = prev.fetch_preview();
    println!("Here is the preview of this URL: {:?}", &preview);

    /** PreviewResponse {
       description: Some("You bring the passion, we bring the music! Access more than 73 million tracks, anytime, anywhere!"),
       title: Some("Deezer | Listen to music | Online music streaming platform"),
       url: Some("http://www.deezer.com"),
       name: Some("Deezer"),
       image: Some("https://e-cdns-files.dzcdn.net/img/common/opengraph-logo.png")
     }
     **/
Commit count: 15

cargo fmt