Merge lp:~markjtully/gwibber/foursquareapi20120612 into lp:gwibber

Proposed by Mark Tully on 2012-06-12
Status: Merged
Merged at revision: 1367
Proposed branch: lp:~markjtully/gwibber/foursquareapi20120612
Merge into: lp:gwibber
Diff against target: 47 lines (+8/-4)
1 file modified
gwibber/microblog/plugins/foursquare/__init__.py (+8/-4)
To merge this branch: bzr merge lp:~markjtully/gwibber/foursquareapi20120612
Reviewer Review Type Date Requested Status
Ken VanDine 2012-06-12 Approve on 2012-06-15
Review via email: mp+109941@code.launchpad.net

Description of the change

Fixes breakage due to recent changes to the Foursquare API.

To post a comment you must log in.
Ken VanDine (ken-vandine) wrote :

Looks good, thanks!

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-04-10 17:42:04 +0000
3+++ gwibber/microblog/plugins/foursquare/__init__.py 2012-06-12 21:29:19 +0000
4@@ -9,7 +9,7 @@
5
6 PROTOCOL_INFO = {
7 "name": "Foursquare",
8- "version": "4.0",
9+ "version": "5.0",
10
11 "config": [
12 "private:secret_token",
13@@ -112,7 +112,7 @@
14 m["sender"] = {}
15 m["sender"]["id"] = data["user"]["id"]
16 m["sender"]["image"] = data["user"]["photo"]
17- m["sender"]["url"] = data["user"]["canonicalUrl"]
18+ m["sender"]["url"] = "https://www.foursquare.com/user/" + data["user"]["id"]
19 if data["user"]["relationship"] == "self":
20 m["sender"]["is_me"] = True
21 else:
22@@ -131,6 +131,10 @@
23 m["photo"]["name"] = ""
24 m["type"] = "photo"
25
26+ if data.has_key("likes"):
27+ if data["likes"]["count"] > 0:
28+ m["likes"]["count"] = data["likes"]["count"]
29+
30 m["sender"]["name"] = fullname
31 m["sender"]["nick"] = fullname
32
33@@ -158,7 +162,7 @@
34 "id" : comment["user"]["id"],
35 "is_me": False,
36 "image": comment["user"]["photo"],
37- "url" : comment["user"]["canonicalUrl"]
38+ "url" : "https://www.foursquare.com/user/" + comment["user"]["id"]
39 }
40 # Create a comment
41 m["comments"].append({
42@@ -252,4 +256,4 @@
43 Returns:
44 A list of gwibber compatible objects which have been parsed by the parse function
45 """
46- return self._get("checkins/recent")
47+ return self._get("checkins/recent", v=20120612)

Subscribers

People subscribed via source and target branches