[RELEASE] Googlejson - Python interface for google searches
This is a release for addon developers, not XBMC end users.
Get it from the Github repo

I've written a module that uses google's JSON api, to provide fast access to google searches.
It returns unicode etc. Its better than parsing html of a google search which is slow, especially if you want many results.

This is set to be used in Videofalcon, but i thought i'd share it, as it is very very useful in creating search functions for sites in xbmc.

you can pump the search to search only urls beginning with the site url
you can even do
site = 'my_site.com/the-thing-that-prefixes-tv-show-urls'
to only return tvshow results
ie. do
site = 'http://tvshack.bz/tv/overview'
if tv show urls are

With a little more innovation you can make it even more specific.
Like filter the results by only displaying results that contain perfect matches of the searchterm in the title, or contain 'Episode List' etc. You can use re.search to do this, but you'll want to make sure that the re.IGNORECASE flag is set.

I recommend you do something like this in your addon:
(using the commonly used addDir function)

PHP Code:
import googlejson

googlejson.doSearch('for teh lulz',2,3,site='ohinternet.com')
page in lulz:
i in page:
addDir (i['titleNoFormatting'],i['url'],mode)
not lulz:
'no results found' 

For more documentation view the README on the Github page.
bump. this is really useful, i hope addon coders see it.
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Googlejson - Python interface for google searches00