Open larjona opened 11 years ago
Paul Wise from Debian shared his solution for downloading the ActivityStream of debian@identi.ca (around 1300 dents right now):
ffor offset in 0 200 400 600 800 1000 1200 1400 ; do wget --no-cookies --header 'Cookie: connect.sid=...' "https://identi.ca/api/user/debian/feed?count=200&offset=$offset" ; done
Some notes:
Hope it helps
A quick hack by kabniel@microca.st to get a convo tree you're part of in pypump (Thanks!):
"""
Get conversation trees you are part of
tested in pypump-shell 0.6
"""
def get_tree(limit=20):
def get_branch(obj):
root = {'obj': obj,
'children': []
}
for i in obj.comments:
root['children'].append(get_branch(i))
return root
mytree = {}
for activity in pump.me.outbox[:limit]:
try:
if activity.verb == 'post':
obj = activity.obj
while obj.in_reply_to is not None:
# dig down to the convo root
obj = obj.in_reply_to
if mytree.get(obj.id):
continue
else:
# build the branches
mytree[obj.id] = get_branch(obj)
except Exception as e:
print(e)
return mytree
def print_tree(mytree):
def print_branch(branch, indent=0):
print(u" "*indent + str(branch['obj'])) #only print obj strings for now
for i in branch['children']:
print_branch(i, indent+1)
for k,v in mytree.items():
print_branch(v)
mytree = get_tree(limit=20)
print_tree(mytree)
I've written a script (and howto) following Paul Wise's hints, to backup major and minor feed. It's available at https://gitorious.org/pumpscripts/pumpscripts
It would be nice to have a link to download a backup for the user's pump.io account, as it's possible in identi.ca (running StatusNet). I'm not sure if just providing in the "account" or "settings" page a download link/button to the feed and the inbox JSONs would be enough: /api/user//feed
/api/user//inbox