thomasleister / mastopurge Goto Github PK
View Code? Open in Web Editor NEWPurges Mastodon accounts. Removes posts. Makes things clean again.
License: MIT License
Purges Mastodon accounts. Removes posts. Makes things clean again.
License: MIT License
Optionally ignore status replies via "exclude_replies" url parameter
I have posts older than May, 30th. However, they are not deleted.
pi@raspberrypi:~ $ cd /home/pi/Programs/mastopurge && ./mastopurge --noninteractive --maxage "30 days"
2021/06/29 16:27:07 MastoPurge configuration found! Reading config.
2021/06/29 16:27:07 Requesting access to Mastodon account
2021/06/29 16:27:07 Access GRANTED :-)
2021/06/29 16:27:07 >>> Account ID: 000000
2021/06/29 16:27:07 >>> Username: xxxxxx
2021/06/29 16:27:07 Posts older than May 30, 2021 at 4:27:07 PM CEST will be deleted!
2021/06/29 16:27:07 ========== Fetching pinned statuses ==========
2021/06/29 16:27:07 Found 0 pinned statuses, which will not be deleted.
2021/06/29 16:27:07 ========== Fetching new statuses until status 0 ==========
2021/06/29 16:27:08 No posts to be deleted on this page. Trying next page ...
2021/06/29 16:27:08 ========== Fetching new statuses until status 00000000000000000 ==========
2021/06/29 16:27:08 0 statuses were successfully deleted.
Mastopurge reports "Status xyz could not be deleted :(", but delete was actually successfull.
Example log:
Welcome to ...
_
_ __ ___ __ _ ___| |_ ___ _ __ _ _ _ __ __ _ ___
| '_ ` _ \ / _` / __| __/ _ \| '_ \| | | | '__/ _` |/ _ \
| | | | | | (_| \__ \ || (_) | |_) | |_| | | | (_| | __/
|_| |_| |_|\__,_|___/\__\___/| .__/ \__,_|_| \__, |\___|
|_| |___/
... add German Datenhygiene to your Mastodon-Account!
2019/08/26 21:25:00 Version 1.1.0
2019/08/26 21:25:00 MastoPurge configuration found! Reading config.
2019/08/26 21:25:00 Requesting access to Mastodon account
2019/08/26 21:25:00 Access GRANTED :-)
>>> Account ID: 137231
>>> Username: storchp
Enter the maximum age of the posts you want to KEEP, e.g. "30 days". Older posts will be deleted. Allowed units: hours, days, weeks, months.
[Maximum post age]: 90 days
Okay, let's do it!
Posts older than 2019-05-28 21:25:05.380842714 +0200 CEST m=-7775994.827013465 will be deleted!
Loading gun ........................................
2019/08/26 21:25:09 ========== Fetching new statuses until status 0 ==========
2019/08/26 21:25:09 No posts to be deleted on this page. Trying next page ...
2019/08/26 21:25:09 ========== Fetching new statuses until status 102444455599... ==========
2019/08/26 21:25:10 No posts to be deleted on this page. Trying next page ...
2019/08/26 21:25:10 ========== Fetching new statuses until status 102185670564... ==========
2019/08/26 21:25:10 Status 10162535146... could not be deleted :(
2019/08/26 21:25:11 Status 10162038453... could not be deleted :(
2019/08/26 21:25:11 Status 10161511149... could not be deleted :(
2019/08/26 21:25:11 Status 10161510716... could not be deleted :(
2019/08/26 21:25:11 Status 10161155067... could not be deleted :(
...
2019/08/26 21:25:13 Status 10153531623... could not be deleted :(
2019/08/26 21:25:13 Status 10152979584... could not be deleted :(
2019/08/26 21:25:13 Status 10152407220... could not be deleted :(
2019/08/26 21:25:13 Status 10152353359... could not be deleted :(
>>>>>> Server has run hot and is throttling. We have to wait for 286 seconds until it has cooled down. Please be patient ...
...
2019/08/26 23:00:02 0 statuses deleted.
2019/08/26 23:00:03 ========== Fetching new statuses until status 101331659697995104 ==========
>>>>>> 0 statuses were successfully deleted.
But actually it deleted over 100.
It would be very nice if you could optionally export the posts to be deleted before. Just because you basically want to minimize your traces on the internet doesn't mean that you don't want to keep some good conversations or especially helpful ones.
I tried but I got "{"error":"Invalid credentials"}"
Even when I know I'm using the right credentials.
maybe related to this: https://git.pleroma.social/pleroma/pleroma/-/issues/2282
thanks you very much
Optionally, don’t delete toots with more than a configurable number of interactions (boosts, replies, favourites). People should have the option to get rid of their unpopular toots and preserve their best receive/most impactful toots.
Use case: Cleanup only "private" toots, leaving public toots intact.
I only want to delete toots, that are non-public, i.e. unlisted, followers-only or a DM.
Could you integrate this filter? Maybe just as a checkbox "keep public toots"?
Normal:
{"error":"Throttled"}
Sometimes in german:
2017/11/28 09:48:41 ========== Fetching new statuses ==========
{"error":"Du wurdest gedrosselt"}
2017/11/28 09:48:41 json: cannot unmarshal object into Go value of type []main.Status
[thomas@thomas-nb]~/Downloads%
Throttling is then not detected and Mastopurge crashes.
Store credentials file in User home directory instead of current directory.
It'd be great if mastopurge could be run non-interactively, e.g. through a cron job. Either the max duration could be saved in the config file or provided through a command-line flag.
Show how many statuses have been processed e.g.
102 of 1200 statuses processed. (xx %)
Sometimes mastopurge will need to be restarted, erroring out on the follow message:
2020/08/02 02:00:15 Get [URL REMOVED]: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
It'd be nice if something was in place to handle timeouts and retry rather than mastopurge just exiting.
Maybe add a flag to also un-boost toots? Reasoning being, clearing a profile or something similar.
It would be nice if you could choose to only delete replies.
Thanks!
From 2.0.0rc1 release notes:
All id attributes in the REST API responses, including attributes that end in _id, are now returned as strings instead of integers. This is because large integers cannot be encoded in JSON losslessly, and all IDs in Mastodon are now bigint. Some apps will not work with this release until they are updated
Does this affect Mastopurge?
I built 1.1.0 on Windows with "go build" and got the following error after typing my instance name.
2018/07/25 09:20:53 Version 1.1.0
2018/07/25 09:20:53 MastoPurge configuration file .mastopurgesettings does not exist or is not accessible.
First we need to connect MastoPurge to your Mastodon account.
Enter the domain of your Mastodon home instance: (e.g. "metalhead.club")
[Mastodon home instance]: retro.social
2018/07/25 09:20:58 >>>>>> Registering MastoPurge App on retro.social
/api/v1/apps: invalid character "\r" in host name
Toots pinned to people’s profiles shouldn’t be deleted, regardless of how old they are.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.