1
0
Fork 0

Add description scriplet to test connection

main
Jeff Moe 2023-04-24 11:46:40 -06:00
parent 9e79dd0ef3
commit 8891927ed3
2 changed files with 41 additions and 1 deletions

View File

@ -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
```

31
src/description 100755
View File

@ -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 <http://www.gnu.org/licenses/>.
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)