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/
精彩评论