Mastodon
It seems to be a Twitter-like service. Open Source. For the time being, until Toot (Tweet on Twitter) in Python.
It seems that there are Python and Ruby, so I will do it with Python for the time being.
pip install Mastodon.py
An instance (https://mastodon.nil.nu) has been created as a Japanese mackerel, so I will Toot there. Get an account on the instance.
from mastodon import Mastodon
Mastodon.create_app("yourapp", #client name
                    api_base_url = "https://mastodon.nil.nu", #Access destination
                    to_file = "yourapp_clientcred.txt" #Output destination file name
)
from mastodon import Mastodon
mastodon = Mastodon(
    client_id="yourapp_clientcred.txt", #The guy made by registration
    api_base_url = "https://mastodon.nil.nu")
mastodon.log_in(
    "[email protected]", # ID(Registered e-mail address)
    "xxxx", # password
    to_file = "your_usercred.txt") #Output destination file name
Toot
from mastodon import Mastodon
mastodon = Mastodon(
    client_id="yourapp_clientcred.txt", #The guy made by registration
    access_token="your_usercred.txt", #The one made by logging in
    api_base_url = "https://mastodon.nil.nu")
mastodon.toot("Your message")
Someone make a client.
Recommended Posts