Here are the minimum steps to tweet using the Twitter API in Python. It has been confirmed to work with Python 3.5.1.
There is a Ruby version article I wrote before, so please refer to it. Tweet using Twitter API in Ruby
Execute the following command on the command line.
$ pip install python-twitter
tweet.py
# -*- coding: utf-8 -*-
import twitter
api = twitter.Api(consumer_key="Enter Consumer Key",
consumer_secret="Enter Consumer Secret",
access_token_key="Enter Access Token",
access_token_secret="Enter Access Token Secret"
)
api.PostUpdate("tweet from my app")
$ python3 tweet.py
Recommended Posts