Created
November 8, 2013 21:46
-
-
Save korayal/7378198 to your computer and use it in GitHub Desktop.
FF'ten feedleri çekme şeyi. commentler/layklar hariç.
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 urllib2 | |
import json | |
# Update values from here : https://friendfeed.com/account/api | |
username = "korayal" | |
remotekey = "" | |
index = 10000 | |
mainurl = "http://friendfeed-api.com/v2/feed/%s" % username | |
# create a password manager | |
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() | |
password_mgr.add_password(None, mainurl, username, remotekey) | |
handler = urllib2.HTTPBasicAuthHandler(password_mgr) | |
opener = urllib2.build_opener(handler) | |
opener.open(mainurl) | |
urllib2.install_opener(opener) | |
path = "%s?start=" % mainurl | |
with open("fflist.txt", "w+") as f: | |
for i in range(0, index, 10): | |
feed = urllib2.urlopen(path + str(i)) | |
js = json.load(feed) | |
if len(js["entries"]) == 0: | |
break | |
for entry in js["entries"]: | |
f.write(str(entry) + "\n") | |
print i, "completed" | |
print("COMPLETED!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment