Created
November 14, 2013 14:28
-
-
Save Radzell/7467753 to your computer and use it in GitHub Desktop.
Radzell Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib2 | |
import httplib2 | |
from urlparse import urlparse, parse_qs | |
from pprint import pprint | |
id=None | |
status = 200 | |
while status==200: | |
if(id): | |
resp, content = httplib2.Http().request('http://letsrevolutionizetesting.com/challenge.json'+'?id='+id) | |
else: | |
resp, content = httplib2.Http().request('http://letsrevolutionizetesting.com/challenge.json') | |
status = resp.status | |
data = json.loads(content) | |
if(not data.has_key('follow')): | |
print data['message'] | |
break | |
id = parse_qs(urlparse(data['follow']).query, keep_blank_values=True)['id'][0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment