Category Archives: PHP

PHP script to count Google backlinks and Indexed Pages

To get backlinks and indexed page count from Google most webmasters use scrapping Google search page. It is not a good idea because it fails some time and very slow.

So we can use Google Ajax search API instead of scrapping whole page. It will return data in JSON object which is much smaller then html page.
Although Ajax search API is rate limited to 100 queries per IP per Day but still it’s a good way. Continue reading

Convert relative path into absolute url

I was developing a tool which extracts all links from webpage but I was getting relative path (e.g. /dir/page.html) instead of absolute url (e.g. http://www.example.com/dir/page.html). Most of websites use relative path to link internal page and browser can convert in into absolute url but php don’t have any inbuilt function to do this. So after searching internet I found one which can convert relative path into absolute url. This is one of the important function for php programmer but missing in php language Continue reading

Read Rss/Atom feed using php

Web feed is a data format used to provide updates for blog or website. Most common types of feed are Rss and Atom. In this article you will learn how to read these feeds using php.

As we know that feeds are generated by using XML, so generic way to parse it by using php5 simplexml_load_file function. But we have to write different functions to parse different types of feed and versions.

To do this in simple way there is a php class named SimplePie

Continue reading