Google Pagerank API for Python

I decided to write this post based on the lack of functionality of the Pagerank tools for python. Checking the pagerank of a URL is fairly simple, thanks to netscripter. However, the major feature of the pagerank tool is collecting URLS to check the pagerank for. If you are among the 90% of internet users, you use google to search. Using my Google Search API for Python, you can get a list of URLS, given a query and now, with the Google Pagerank API in Python, you can get a dictionary of urls, keyed by their numeric pagerank.

Download Google Search API for Python

Download Google Pagerank API for Python

>>> from PageRank import getUrlsWithPageRank
>>> prUrls = getUrlsWithPageRank('blackcodeseo.com', 10)
 
>>> prUrls.keys()
[0, 1, 2]
 
>>> prUrls[2]
['http://blackcodeseo.com/']
 
>>> prUrls[1]
['http://blackcodeseo.com/black-code-seo-forum/comment-page-1/']
 
>>> prUrls[0]
['http://forums.blackcodeseo.com/', 'http://forums.blackcodeseo.com/list.php?6', 'http://chexmedia.com/technology/blackcodeseocom/', 'http://whois.domaintools.com/blackcodeseo.com', 'http://www.w3who.com/blackcodeseo.com', 'http://www.mail-archive.com/python-list@python.org/msg223994.html', 'http://pipl.com/directory/name/Code/Black', 'http://www.alexa.com/siteinfo/www.blackcodeseo.com']

Leave a comment

You must be logged in to post a comment.