像facebook一样的Django url图像提取

发布于 2024-09-28 21:48:44 字数 49 浏览 4 评论 0原文

有谁知道是否有一个可插拔的应用程序可以用来实现 Django 的 url 图像提取?

Does anybody know if there is a pluggable app that you can use to achieve url like image extraction for Django?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弃爱 2024-10-05 21:48:44

我不知道是否有一个可插入的应用程序可以为您执行此操作,但您可能可以自己将其组合在一起。

据我所知,唯一能促进这一点的“标准”是 oEmbed (http://www.oembed.com/),它基本上是这样工作的:

  • 有人给你一个 URL。
  • 你阅读它,发现它是一个有效的 JSON,与 oembed 结构匹配
  • 成功!

除了上述之外,我认为 facebook 也做了什么(因为我查看了一些 twitter 和 fb 都可以使用的网站,但没有一个网站有任何我能看到的 oembed 支持),就是通过以下方式处理一个案例:案例依据。他们可能让开发人员浏览各种各样的网站并查看可用的元标记类型。例如,yfrog 有一堆元属性,可以直接告诉您正在显示的主图像的 url、所有者、图像附带的推文等。之后就是尽力猜测。这就是为什么当您尝试在 Facebook 上分享博客文章时,它通常会为您提供该博客文章附带的任何一张图像的选项,因为它不知道哪一张是主要图像。

I dont know if there is a pluggable app that will do this for you, but you can probably hack this together yourself.

The only 'standard' I know of that facilitates this is oEmbed (http://www.oembed.com/) which basically works this way:

  • somebody gives you a URL.
  • you read it, find that its a valid JSON that matches the oembed structure
  • success!

other than the above, and what I think facebook does as well (since I took a look at a few sites that both twitter and fb would work with and none have any oembed support that I can see), is to work on a case by case basis. They probably had a developer go through a large variety of sites and look at the type of meta tags available. for example, yfrog has a bunch of meta properties that tell you the url directly to the main image being displayed, the owner, the tweet that went along with the image, etc. After that it's best effort guesswork. that's why when you try to share a blog post on facebook, it'll often give you the option of any one of the images that went with that blog post, because it doesn't know which one is the main one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文