Skip to content

Commit

Permalink
Merge pull request mobolic#81 from yjaaidi/master
Browse files Browse the repository at this point in the history
Use urllib2.urlopen instead of urllib.urlopen so that proxies work. Thanks to yjaaidi and George Haidar (disintegrator).
  • Loading branch information
martey committed Oct 9, 2013
2 parents 0f6dc1a + 341481c commit a889d29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ def extend_access_token(self, app_id, app_secret):
"grant_type": "fb_exchange_token",
"fb_exchange_token": self.access_token,
}
response = urllib.urlopen("https://graph.facebook.com/oauth/"
"access_token?" +
urllib.urlencode(args)).read()
response = urllib2.urlopen("https://graph.facebook.com/oauth/"
"access_token?" +
urllib.urlencode(args)).read()
query_str = parse_qs(response)
if "access_token" in query_str:
result = {"access_token": query_str["access_token"][0]}
Expand Down Expand Up @@ -516,8 +516,8 @@ def get_access_token_from_code(code, redirect_uri, app_id, app_secret):
}
# We would use GraphAPI.request() here, except for that the fact
# that the response is a key-value pair, and not JSON.
response = urllib.urlopen("https://graph.facebook.com/oauth/access_token" +
"?" + urllib.urlencode(args)).read()
response = urllib2.urlopen("https://graph.facebook.com/oauth/access_token" +
"?" + urllib.urlencode(args)).read()
query_str = parse_qs(response)
if "access_token" in query_str:
result = {"access_token": query_str["access_token"][0]}
Expand Down

0 comments on commit a889d29

Please sign in to comment.