• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

KEINOS/Mastodon_Simple-Toot-Deleter: ✅ Simple PHP script to delete all your too ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

KEINOS/Mastodon_Simple-Toot-Deleter

开源软件地址(OpenSource Url):

https://github.com/KEINOS/Mastodon_Simple-Toot-Deleter

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

Simple toot deleter for Mastodon

This simple PHP script deletes all your toots from your Mastodon instance.

TL;DR

Copy the script, edit and fill out the settings in the source code and run.

It worked on macOS and RaspbianOS.

TS;DR

How to use (Detail)

  1. Go to your Mastodon account settings and create an access_token.

  2. Create a new PHP file. (ex: delete_toot.php)

  3. Copy and paste the source.

  4. Don't forget to chmod the script file as executable. (ex: $ chmod 0755 delete_toot.php)

  5. Run the script once and it will create a JSON file for user settings.

    $ php delete_toot.php

  6. Then edit the JSON file and change the values below.

    • scheme -> ex. https
    • host -> ex. qiitadon.com
    • access_token -> Get it from your instance's settings.

    Optional:

    • id_skip -> Set toot IDs to skip deleteing.
    • time_sleep -> Must be more than 1. The bigger the slower.
    • id_account -> Leave it blank then the script will auto fill.
  7. Run the script again and wait until it's done.

    Note1 : To run it background see below. Note2 : Don't forget to delete 'nohup.out' file after finish.

How do I get the access token?

  1. Open your Mastodon account settings.
  2. Go to "</> Development" setting and open "Your applications".
  3. Create "NEW APPLICATION" with the settings below.
  • Application name : Any name you want and easy to notice.
  • Application website : Any web site, may be this GitHub page.
  • Redirect URI : Leave it as is.
  • Scopes : Check all.

Note: Don't forget to delete this application entry after use. (For sureness)

Why it's slow?

This script deletes 1 toot/second by default because of the Mastodon's access limitation.

Since there's an access time limitation to use the API and if you request more than 300 authorized requests in 5 minutes ( 1 authorized request per second) / account, you'll get a "Too many request" error. Therefore this script is slow.

Running the script in background

$ # Check the current PID to compare
$ ps
$ 
$ # Run the script in background then press Ctrl+c to exit
$ nohup php ./delete_toot.php &
$
$ # Recheck the PID to see if the script is running
$ ps
$
$ # See the progress to check
$ tail -f nohup.out

Operation environment tested

Topic Content
Confirmation date 2018/03/12
Mastodon v2.1.0
OS macOS High Sierra(OSX 10.13.3)
Machine MacBookPro(Retina, 13-inch, Early 2015)
$ php -v PHP 7.1.8 (cli) (built: Aug 7 2017 15:02:45) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
$ bash --version GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.
$ curl --version curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy
Topic Content
Confirmation date 2018/04/14
Mastodon v2.2.0
OS Raspbian GNU/Linux 8.0 (jessie)
Machine RaspberryPi 3
Hardware : BCM2835
Revision : a22082
$ php -v PHP 7.1.12-1+020171129100725.11+jessie1.gbp8ded15 (cli) (built: Dec 1 2017 04:22:35) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.12-1+020171129100725.11+jessie1.gbp8ded15, Copyright (c) 1999-2017, by Zend Technologies
$ bash --version GNU bash, バージョン 4.3.30(1)-release (arm-unknown-linux-gnueabihf)
Copyright (C) 2013 Free Software Foundation, Inc.
$ curl --version curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap