@Moon @raccoon easy couple liner in python utilizing the mastodon.py library
!/usr/bin/env python3 import os import sys import toml from mastodon import Mastodon basepath = os.path.dirname(os.path.abspath(__file__)) settings = toml.load(os.path.join(basepath,'settings.toml')) mastodon = Mastodon( access_token = os.path.join(basepath,'usercred.secret'), api_base_url = settings.get("mastodon_url") ) media = mastodon.media_post("image.png") mastodon.status_post("", None, media_ids=[media], sensitive=False, visibility='public')settings.toml:
mastodon_url="" mastodon_user=""usercred.secret is just your bot's token generated from https://tools.splat.soy/pleroma-access-token/
then you can just chmod a+x script.py and run ./script.py $filename
this will require that you have a library of images tho not pulling them directly
@feditips mastodon.py can also easily do this since it is built into mastodon. It’s just an option of a normal post, nothing magical.
using mastodon.py to access firefish because it's own API is a horror beyond my comprehension :woozy_2x:
@bot
Did you really think I got that number?
Nah but I'm really thinking about making a quick and dirty twilio <--> mastodon.py conduit
@pwm
I was looking through the API docs for mastodon.py last night, and now I'm fantasizing about writing my own perfect half-finished mastodon client in python.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.