TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Posted Items on Facebook

3 点作者 sangguine将近 17 年前
Hi. I have a technical question about how Facebook does something using PHP. On Facebook, if you enter a link on Posted Items, Facebook automatically grabs the title, the thumbnail and the few first sentences. Do you know what they use? cURL maybe? If they do use cURL, do you think they would store this info in a database or pull this info every time?

4 条评论

nertzy将近 17 年前
Here's how to find out:<p>Set up a page on a server you control that has a URL you know that Facebook has never seen.<p>Start making a posted item on Facebook with that URL.<p>Check your logs and see what User-Agent Facebook is using, and try to get your best guess as to what is going on.<p>Beyond the User-Agent (which might just be something like "Facebook") you could always dive deeper by investigating the actual packets sent and comparing them to those generated by something like wget or cURL.
wave将近 17 年前
The easiest way will be to use Alexa Site Thumbnail from AWS <a href="http://tinyurl.com/57zbp2" rel="nofollow">http://tinyurl.com/57zbp2</a> , which charges $0.0002/thumbnail.
bkrausz将近 17 年前
Title and first sentence are probably grabbed directly (probably cURL), it's trivial to snag a &#60;title&#62; tag and the first &#60;p&#62; tag. They definitely cache them somewhere, since pulling them every time would do terrible things to load time and is unreliable.
评论 #205817 未加载
ComputerGuru将近 17 年前
cURL can't grab the thumbnails - you need to run the HTML through a rendering engine to do that.