Permalink
Browse files

import urlencode

  • Loading branch information...
1 parent d067674 commit fefade870a55e5166c2fc3efd9b46ef0df673dee @edsu edsu committed May 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 plugins/StackEx/plugin.py
View
3 plugins/StackEx/plugin.py
@@ -2,6 +2,7 @@
import time
import gzip
import logging
+import urllib
import urllib2
import HTMLParser
@@ -71,7 +72,7 @@ def textify(html):
def shorten(url):
params = {'longUrl' : longUrl, 'login' : 'zoia', 'apiKey' : 'R_e0079bf72e9c5f53bb48ef0fe706a57c', 'version' : '2.0.1', 'format' : 'json'}
- url = 'http://api.bit.ly/shorten?' + urlencode(params)
+ url = 'http://api.bit.ly/shorten?' + urllib.urlencode(params)
response = json.loads(urllib2.urlopen(url).read())
return response['results'][longUrl]['shortUrl']

0 comments on commit fefade8

Please sign in to comment.