From 8891927ed37ccedd60c18d68ce904f7f59dc119f Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Mon, 24 Apr 2023 11:46:40 -0600 Subject: [PATCH] Add description scriplet to test connection --- RMFOLLOW.md | 11 ++++++++++- src/description | 31 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 src/description diff --git a/RMFOLLOW.md b/RMFOLLOW.md index 3432a0e..bcc443c 100644 --- a/RMFOLLOW.md +++ b/RMFOLLOW.md @@ -32,7 +32,11 @@ pip install -r requirements.txt # Configure Configure thusly. -Set URL for API and API password (token). + +Go to your Mastodon web page, click `Development` and `New Application`. +Set permissions there. + +Set URL for API and API password from above. ``` @@ -47,6 +51,11 @@ Use thusly. ``` cd mastodon/ source env/bin/activate + +# Get Mastodon instance description, to make sure API url/password are ok. +./src/description + +# XXX not yet ./src/rm-follower-spam ``` diff --git a/src/description b/src/description new file mode 100755 index 0000000..ac73fa2 --- /dev/null +++ b/src/description @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# +# description +# +# Copyright (C) 2023, Jeff Moe +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from mastodon import Mastodon +from settings import password, url + +mastodon = Mastodon( + access_token=password, + api_base_url=url +) + +description = mastodon.account_verify_credentials().source.note + +print(description) +