Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to backup account #670

Open
larjona opened this issue Jun 16, 2013 · 3 comments
Open

Provide a way to backup account #670

larjona opened this issue Jun 16, 2013 · 3 comments
Milestone

Comments

@larjona
Copy link
Collaborator

larjona commented Jun 16, 2013

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

@larjona
Copy link
Collaborator Author

larjona commented Mar 8, 2014

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:

  • Copied the cookie header from the browser
  • When made a new dent, it has to be repeated

Hope it helps

@larjona
Copy link
Collaborator Author

larjona commented Jun 11, 2014

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)

@larjona
Copy link
Collaborator Author

larjona commented Nov 7, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant