[kupfer] google_search: Unquote URLs from the live google search plugin



commit a2f1047b519874d5f2d3a64c69a5c8fdc09f3ba8
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Mar 3 22:58:26 2011 +0100

    google_search: Unquote URLs from the live google search plugin
    
    (FIXME: This API is deprecated according to Google so the plugin needs
    update)

 kupfer/plugin/google_search.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/google_search.py b/kupfer/plugin/google_search.py
index 3c4abde..47931af 100644
--- a/kupfer/plugin/google_search.py
+++ b/kupfer/plugin/google_search.py
@@ -62,7 +62,8 @@ class SearchResults (Source):
 		more_results_url = data['cursor']['moreResultsUrl']
 		total_results = data['cursor'].get('estimatedResultCount', 0)
 		for h in data['results']:
-			yield UrlLeaf(h['url'], h['titleNoFormatting'])
+			uq_url = urllib.unquote(h['url'])
+			yield UrlLeaf(uq_url, h['titleNoFormatting'])
 		yield CustomDescriptionUrl(more_results_url,
 				_('Show More Results For "%s"') % self.query,
 				_("%s total found") % total_results)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]