#preview #metadata #links #fetching #url #image #shorturls

bin+lib preview-rs

一个用于从短网址和链接中获取预览元数据的(简单)crate

4 个版本

0.1.3 2022 年 9 月 11 日
0.1.2 2022 年 9 月 11 日
0.1.1 2022 年 9 月 5 日
0.1.0 2022 年 9 月 5 日

#836 in 图像

MIT 许可证

13KB
214

Preview-rs

一个用于获取 URL 预览元数据的 Rust crate。

待完成事项

  • 特别是对于图像,更多的回退选项。
  • 支持比图像更多的多媒体选项(视频、png 等)。
  • 允许在请求中传递自定义用户代理。

用法

    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")
     }
     **/

依赖关系

~7–19MB
~307K SLoC