Merge lp:~ken-vandine/gwibber/foursquare_network into lp:gwibber

Proposed by Ken VanDine
Status: Merged
Merged at revision: 1285
Proposed branch: lp:~ken-vandine/gwibber/foursquare_network
Merge into: lp:gwibber
Diff against target: 26 lines (+5/-5)
1 file modified
gwibber/microblog/plugins/foursquare/__init__.py (+5/-5)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/foursquare_network
Reviewer Review Type Date Requested Status
David Klasinc (community) Approve
Review via email: mp+93480@code.launchpad.net

Description of the change

use the gwibber Downloader instead of urllib2 directly

To post a comment you must log in.
Revision history for this message
David Klasinc (bigwhale) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gwibber/microblog/plugins/foursquare/__init__.py'
--- gwibber/microblog/plugins/foursquare/__init__.py 2012-02-10 10:06:59 +0000
+++ gwibber/microblog/plugins/foursquare/__init__.py 2012-02-16 19:15:24 +0000
@@ -1,6 +1,6 @@
1from gwibber.microblog import network, util1from gwibber.microblog import network, util
2from gwibber.microblog.util import resources2from gwibber.microblog.util import resources
3import urllib, urllib2, json, htmllib, re3import json, re
4from gettext import lgettext as _4from gettext import lgettext as _
55
6import logging6import logging
@@ -134,10 +134,10 @@
134 url = "/".join((URL_PREFIX, path))134 url = "/".join((URL_PREFIX, path))
135 135
136 url = url + "?oauth_token=" + self.token136 url = url + "?oauth_token=" + self.token
137 #137
138 # TODO: Proxy support. Where's Downloader?138 data = network.Download(url, None, post).get_json()["response"]
139 #139
140 data = json.load(urllib2.urlopen(url))["response"]140 resources.dump(self.account["service"], self.account["id"], data)
141141
142 if isinstance(data, dict) and data.get("errors", 0):142 if isinstance(data, dict) and data.get("errors", 0):
143 if "authenticate" in data["errors"][0]["message"]:143 if "authenticate" in data["errors"][0]["message"]: