If you are creating a search engine, a crawler, or whatever, that deals with sites, and you want to grab a description, author, keyword, etc. then PHP has the solution for you.This function allows you to enter a site's URL, and it will automatically parse the page searching for meta-tags, ending at the head tag. How easy can crawling meta-tags be!
This is the function
get_meta_tags();
Let me give you an example. Pixel2Life is one of my most favorite tutorial sites. I made a file with the contents
print_r(get_meta_tags("http://www.pixel2life.com"));
?>
When I view it in my browser, it will list the contents of an array with all the meta-tags. The key of an entry is the name of the tag, the value is the contents.
I got this result
Array
(
[author] => Pixel2life.com
[copyright] => Content Copyright Pixel2life.com. All rights reserved.
[keywords] => Photoshop Tutorials, Tutorial Index, Tutorials, Tutorial Search Engine, Flash, Macromedia, Adobe, Photoshop, Corel, Coreldraw, Photopaint, HTML Tips and Tricks, PHP Coding, ASP, SQL, Free Image Hosting, Forums, Help, Search, Free Tutorials, Free Hosting, Services, Sig Files, 3d Studio Max
[description] => Pixel2life is the largest tutorial search engine on the internet catering to graphic designers and programmers. From Photoshop to Poser to C++, we have it all in the fastest and friendliest search tool around.
)
I can now use the description in my search engine (if I had one, of course), and split the keywords on the comma, and use these for searching.
45n5 (946) says on November 1, 2007:
interesting, I didn't know php had built in functions to grab meta tags. they need one to parse links also ;-)


