From 0b89fc9c5c27367629b13ebc77594af51b7cfeca Mon Sep 17 00:00:00 2001 From: sevichecc <91365763+Sevichecc@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:04:26 +0800 Subject: [PATCH] Feat add reminder bot --- README.md | 1 + backup-bot.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 backup-bot.py diff --git a/README.md b/README.md index 6f6c584..6a78ecc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ - Use [duplicacy](https://duplicacy.com/) to upload to remote storage - `expect` to deal with user input - Keep a revision every 7 days for revisions older than 30 days +- Backup remindet bot diff --git a/backup-bot.py b/backup-bot.py new file mode 100644 index 0000000..cacc4bf --- /dev/null +++ b/backup-bot.py @@ -0,0 +1,28 @@ +#!/usr/bin/python +import random +from mastodon import Mastodon + +Mastodon.create_app( + 'backupbot', + api_base_url = 'https://your_pleoma_instance.com', + to_file = 'backupbot_clientcred.secret' +) + +mastodon = Mastodon( + client_id = 'backupbot_clientcred.secret', + api_base_url = 'https://your_pleoma_instance.com' +) + +mastodon.log_in( + 'bot_account_username', + 'bot_account_password', + to_file = 'backupbot_usercred.secret' +) + +mastodon = Mastodon( + access_token = 'backupbot_usercred.secret', + api_base_url = 'https://your_pleoma_instance.com', + feature_set = 'pleroma' +) + +mastodon.status_post('your_post_content')