Skip to content

Commit

Permalink
[wikipedia] Don't .encode() the query
Browse files Browse the repository at this point in the history
It's pointless, web.py already handles that
  • Loading branch information
Elad Alfassa committed Mar 6, 2014
1 parent 51c469f commit ac06546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def mw_search(server, query, num):
search_url = ('http://%s/w/api.php?format=json&action=query'
'&list=search&srlimit=%d&srprop=timestamp&srwhat=text'
'&srsearch=') % (server, num)
search_url += query.encode('utf-8')
search_url += query
query = json.loads(web.get(search_url))
if 'query' in query:
query = query['query']['search']
Expand All @@ -50,7 +50,7 @@ def mw_snippet(server, query):
snippet_url = ('https://'+server+'/w/api.php?format=json'
'&action=query&prop=extracts&exintro&explaintext'
'&exchars=300&redirects&titles=')
snippet_url += query.encode('utf-8')
snippet_url += query
snippet = json.loads(web.get(snippet_url))
snippet = snippet['query']['pages']

Expand Down

0 comments on commit ac06546

Please sign in to comment.