Add Google search results to Cardapio

Registered by Thiago Teixeira

The idea is to rename "Other results" to "Other local results", and add another section for "Other web results" which would get information from Google as you type.

This can be easily done using Google's AJAX API:

----------8<---------------8<---------------8<-------------
import urllib2
import simplejson

# This example request includes an optional API key which you will need to
# remove or replace with your own key.
# Read more about why it's useful to have an API key.
# The request also includes the userip parameter which provides the end
# user's IP address. Doing so will help distinguish this legitimate
# server-side traffic from traffic which doesn't come from an end-user.
url = ('http://ajax.googleapis.com/ajax/services/search/web'
       '?v=1.0&q=Paris%20Hilton&key=INSERT-YOUR-KEY&userip=USERS-IP-ADDRESS')

request = urllib2.Request(
    url, None, {'Referer': /* Enter the URL of your site here */})
response = urllib2.urlopen(request)

# Process the JSON string.
results = simplejson.load(response)
# now have some fun with the results...

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Thiago Teixeira
Completed by
Thiago Teixeira

Related branches

Sprints

Whiteboard

(Please APPEND your comments at the end of this whiteboard. And don't forget to identify yourself, as shown below)

-------------------------------------------------------------
[tvst 2010-06-07]

This has been implemented as a[n experimental] plugin!

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.