Here goes the code ,
You need to change the 'cse query string' , import relevant libs.
the key is urlfetch.fetch(url).content.decode("utf-8").encode("ascii",
"ignore") line. :D

def google_cse_get_html(url):
    data = urlfetch.fetch(url).content.decode("utf-8").encode("ascii",
"ignore")
    data = simplejson.loads(data)
    path = os.path.join(os.path.dirname(__file__), 'templates/
gcseaccordion.html')
    return template.render(path, {'search': data})

def get_search_result(query):
    url = 'google.cse.querystring'+urllib.quote_plus(query)
    return google_cse_get_html(url)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to