开发者

good way to go about doing page excerpts

I'm looking to achieve the effect facebook has when you put a link into a message - they scrape the title and some images from it. I noticed they also do it extremely quickly. (they must cache some of the re-sent items?)

Does anyone开发者_开发技巧 have any ideas on how to approach this with PHP? Can I somehow quickly grab the <title> block of the page without cURLing the entire thing?

Thanks!


You would probably have to grab the entire page and use a HTML DOM parser to rip out the title tag.

Like you said, if you want fast speeds consider caching the results.

http://simplehtmldom.sourceforge.net/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜