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
1=== modified file 'gwibber/microblog/plugins/foursquare/__init__.py'
2--- gwibber/microblog/plugins/foursquare/__init__.py 2012-02-10 10:06:59 +0000
3+++ gwibber/microblog/plugins/foursquare/__init__.py 2012-02-16 19:15:24 +0000
4@@ -1,6 +1,6 @@
5 from gwibber.microblog import network, util
6 from gwibber.microblog.util import resources
7-import urllib, urllib2, json, htmllib, re
8+import json, re
9 from gettext import lgettext as _
10
11 import logging
12@@ -134,10 +134,10 @@
13 url = "/".join((URL_PREFIX, path))
14
15 url = url + "?oauth_token=" + self.token
16- #
17- # TODO: Proxy support. Where's Downloader?
18- #
19- data = json.load(urllib2.urlopen(url))["response"]
20+
21+ data = network.Download(url, None, post).get_json()["response"]
22+
23+ resources.dump(self.account["service"], self.account["id"], data)
24
25 if isinstance(data, dict) and data.get("errors", 0):
26 if "authenticate" in data["errors"][0]["message"]: