From 76b15eae65f6fcf28a0b3953bce6f73ef2c68ee2 Mon Sep 17 00:00:00 2001 From: Chris Rossi Date: Wed, 18 Dec 2013 14:52:53 -0500 Subject: [PATCH] Get json data. --- lms/djangoapps/linkedin/management/commands/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/linkedin/management/commands/__init__.py b/lms/djangoapps/linkedin/management/commands/__init__.py index 5a836bf3fc..9e431b0240 100644 --- a/lms/djangoapps/linkedin/management/commands/__init__.py +++ b/lms/djangoapps/linkedin/management/commands/__init__.py @@ -104,8 +104,9 @@ class LinkedinAPI(object): hashes = ','.join(("email-hash=" + md5(email) for email in emails)) url = "https://api.linkedin.com/v1/people::(%s):(id)" % hashes url += "?oauth2_access_token=%s" % self.tokens.access_token + request = urllib2.Request(url, headers={'x-li-format': 'json'}) try: - response = urllib2.urlopen(url).read() + response = urllib2.urlopen(request).read() print "GOT IT!", response except urllib2.HTTPError, error: self.http_error(error, "Unable to access People API")