Open2
Mastodon
id確認
mastdon_domain=
access_token-
curl -sS -X GET https://${mastdon_domain}/api/v1/accounts/verify_credentials \
--header "Authorization: Bearer ${access_token}" | jq -r .id
自動フォロー (Mastodon.py, python)
pip install Mastodon.py
import time
from mastodon import Mastodon
url =""
token=""
mastodon = Mastodon(
access_token = token,
api_base_url = url
)
keyword="keyword"
for account in mastodon.search(q=keyword)['accounts']:
print(account.id)
account_relationship = mastodon.account_relationships(id=account.id)[0]
time.sleep(0.5)
if account_relationship['following'] == False:
mastodon.account_follow(account.id)