Skip to content
Bot en Twitter con Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
imagenes
README.md
bot.py
demonio.py
imagen.py
os
texto.py
time
twit

README.md

Twitter Bot + CRON

This bot was created to feed the twitter account of #AprendizajeLibre with tweets stored in a text file

Version

1.0.1

Tech

We use the following libraries:

  • Twython - Python wrapper for the Twitter API

Installation

You need Python2.7, and pip to be previously installed:

$ pip install twython

some times you need sudo privileges to execute

Then you have to clone the repository

$ git clone [git-repo-url] /path/to/repo

And finally you have to ask for a twitter accestoken

  1. To use this method, you have to register a cellphone number to the Twitter account that you want to automate.

  2. Create a Twitter App, following this steps:

    • Follow this link twitter developers
    • Click on "Create New App"
    • Fill the form and accept use terms.
    • Once created, go to the tab "Permissions" and change the permissions to "Read, Write and Access direct messages"
    • And finally go to "Keys and Access Tokens" and click over "Create My Access Token" Image of Yaktocat
  3. Fill the infotmation

    # Claves de la aplicacion Twitter
    app_key = "Consumer key"
    app_secret = "Consumer secret"
    oauth_token = "Access token"
    oauth_token_secret = "Access token secret"

Adding excecution to CRON

Execute the following command:

$ crontab -e

The next lines, are an example of crontab schedule syntax that executes the bot every 30 minutes from 17 to 22 hours every day.

*/30 17-22 * * 1-7 /path/to/repo/bot.sh

Special thanks to:

You can’t perform that action at this time.