Created
August 21, 2014 17:47
-
-
Save ClaireNeveu/88f14c3aa4ad4f6d70f6 to your computer and use it in GitHub Desktop.
get Blog follows
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
#!/usr/bin/python | |
from sys import argv | |
import urllib2 | |
import json | |
from time import sleep | |
blogHost = argv[1] | |
def run(host): | |
blogInfo = json.load(urllib2.urlopen("http://api.kinja.com/api/blog/byhost/" + host)) | |
blogId = blogInfo['data']['id'] | |
blogFollows = json.load(urllib2.urlopen("http://api.kinja.com/api/followservice/followedby/blog/" + str(blogId))) | |
for followId in blogFollows['data']: | |
followInfo = json.load(urllib2.urlopen("http://api.kinja.com/api/blog/" + str(followId))) | |
print(followInfo['data']['name']) | |
run(blogHost) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment