I'd Like to get meta tags automaticly for web sites registered on my site. I am using this function http://php.net/manual/en/function.get-meta-tags.php but it is not working 100% Can someone suggest other solution/method Thank you
The best way would be to fetch the page and parse out the info you want. That way, you could extract title, meta's, favicon etc. It's really quite simple - fetch the page (could use curl if you wanted also), a few string functions to chop up the grabbed data and that's it. If I get a chance tomorrow, I'll knock up and test a little script to do this. Si
SiJz, parsing is one option. Before that I am looking some script and function. Dj, we don't have that in our DB. In our form we ask for a web link and in next step we would like to get meta tags automaticly for that site. I know that many directories when you submit your link pull meta tags from your site. That is what we want to do.
using simple_html_dom parser... its just a single php file you need to include in your php file.. use curl or file_get_contents to grab the page from which you need to extract meta tags, say in $page_source then assign it to a variable say, $html by using $html = str_get_html($page_source) Then u can easily find meta tags using something like echo $html->find('meta[name="description"] , 0')->value; echo $html->find('meta[name="keywords"] , 0')->value; Havent tested it, but it should mostly work...