kensanata / mastodon-archive

Archive your statuses, favorites and media using the Mastodon API (i.e. login required)
https://alexschroeder.ch/software/Mastodon_Archive
GNU General Public License v3.0
358 stars 33 forks source link

Linking back to the original for context #7

Closed kensanata closed 3 years ago

kensanata commented 6 years ago

Ed Davies wrote: Any way to link back to the “real” toot? E.g., to see what replies were replying to.

I think for replies, we just get an id, e.g. 99033945374420755. But that's the internal URI, not the visible one. That's why https://mastodon.weaponvsac.space/users/kensanata/statuses/99033945374420755 is an error. You would have to call the API with that id and get the real status, and its URL. I guess we could link the timestamp to the original toot, though, i.e. https://mastodon.weaponvsac.space/users/kensanata/statuses/99035442420065671. We should totally do that.

Then again, this won't help you if the original site goes down, or you delete your account after making the backup. After all, the point of the backup is that you need it when you lose access to the original. That's why I feel it might make sense to actually retrieve all the statuses you have replied to and store them somewhere. Except that this is going to require many requests and that's not cool.

Once we go down that line of thought, we might as well request the context of every toot. Tempting!

kensanata commented 6 years ago

I think linking to the existing toot is good enough for the moment. Fetching the context of every toot is overkill.

fasiha commented 5 years ago

Have the popular use-cases for Mastodon Backup evolved since late 2017? Would this be something you'd consider revisiting?

I use Mastodon Backup to create threaded views of my toots for offline reading, and right now I ignore my replies to others in the backup that Mastodon Backup makes, since those replies have no context. Yes, I do have a link so I can read the full thread, which is nice, but if it makes sense now, it'd be nice to have others' toots in the same JSON file as my replies.

Thanks for considering! This is a very well-designed and ergonomic tool.

kensanata commented 5 years ago

I'm trying to better understand on a UI level. The goal is to have an as-complete-as-possible archive of each thread you participated in? Would that be the entire tree visible to you, i.e. the equivalent of clicking on the top status of the thread and getting everything?

How would this work at the command line: an option that simply said --with-context and then it would do that for every status you posted?

fasiha commented 5 years ago

Sorry for the delay in getting back to you. Looking at the JSON that Mastodon Archive creates, my replies have fields in_reply_to_id and in_reply_to_account_id, and currently, those ids won't be present in my JSON file. Would it be possible to obtain the status of the message that I replied to and put it in the JSON file too?

kensanata commented 5 years ago

Currently the main loop to get statuses is in archive.py:

    if data is None or not "statuses" in data or len(data["statuses"]) == 0:
        print("Get all statuses (this may take a while)")
        statuses = mastodon.account_statuses(user["id"], limit=100)
        statuses = mastodon.fetch_remaining(
            first_page = statuses)
    else:
        print("Get new statuses")
        statuses = complete(data["statuses"], mastodon.account_statuses(user["id"], limit=100))

So what you would have to do next is to loop through every status in your archive, look at it's in_reply_to_id attribute, and fetch it if you don't have it. As the normal status fetching gets you 40 statuses by request, you're adding ×40 requests… Would you still want it? Maybe as a separate subcommand which people could call? I'm not feeling very excited about this. Then again, many of your replies will be to statuses that you were mentioned in, so perhaps it's not that much?

kensanata commented 5 years ago

That reminds me, have you tried mastodon-archive context?

kensanata commented 5 years ago

6f05d4ca01f95e7c4a84d437a3e6132723c34b8a now contains a replies subcommand which will download the replies. They're not taken into account anywhere, but if you like the idea and think it works as intended (check with the context subcommand, I guess?), I'll add it elsewhere.

kensanata commented 3 years ago

Closing again.