Essentials to make your Python project connected to Twitter. Built from TwtPy. Kept small and simple as possible.
- Twitter-Python
Download the repo. Install python-twitter through pip. Generate keys and tokens. Once you have the necessary keys and tokens, open auth.py and insert them.
Start Python
$ python
Import TwtPy via tweet
>>> import tweet
Start Using it
Check your Name
>>> tweet.whoami()
Check your username/screen name
>>> tweet.username()
Tweet Something (without printing any response)
>>> status = "Hello World"
>>> tweet.update(status)
Follow Someone
>>> username = "username_here"
>>> tweet.follow(username)
Unfollow Someone
>>> username = "username_here"
>>> tweet.unfollow(username)
Send a DM
>>> to = "username"
>>> message = "Hi!"
>>> tweet.sendDM(to, message)
- Please do not rename tweet.py as twitter.py
- Get token and keys from https://dev.twitter.com and replace the values in the file.
- This will not work without token and keys.
- This is made for personal projects. Use with caution.
- If you need a fully-featured one, use TwtPy instead
- All returns a response instead of printing them.
This is a personal project and was intended for personal use. You may fork and improve this. Report bugs if you find one.