GithubHelp home page GithubHelp logo

josh123a123 / twittergoggles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pmaconi/twittergoggles

0.0 2.0 0.0 89 KB

A Python 3.3 adaptation of the PHP program "Twitter Zombie", originally developed for the Twitter Search API version 1.0. This new project is built for the Twitter Search API version 1.1.

License: GNU General Public License v3.0

twittergoggles's Introduction

TwitterGoggles

A Python 3.3 adaptation of the PHP program "Twitter Zombie", originally developed for the Twitter Search API version 1.0. This new project is built for the Twitter Search API version 1.1.

Dependencies

  • mysql-connector-python
  • requests
  • requests-oauthlib

Setup and Installation

  1. Install Python 3.3 on the computer you use. Recognize that many standard installations of Python are currently 2.x, and you may need to install Python 3.3 as well. To execute with Python3, you type "python3"
  2. Install the dependencies
    1. Make sure you have "pip" installed on your system (this is a package manager for Python3)
    2. From a command prompt, type:
pip install mysql-connector-python requests requests-oauthlib
  1. Build database
    1. Create empty database
    2. Create new user for db or grant access to an existing user
    3. Run config/schema.sql
  2. Set database config options in config/settings.cfg
  3. Add your OAuth credentials to the oauth table
    1. Get OAuth credentials by setting up an Application at Twitter's Developers site (https://dev.twitter.com/)
    2. EXAMPLE:
INSERT INTO \`oauth\` (\`oauth_id\`, \`name\`, \`consumer_key\`, \`consumer_secret\`, \`access_token\`, \`access_token_secret\`) VALUES (1, 'a name you can remember', 'consumer_key', 'consumer_secret', 'access_token', 'access_token_secret');
5. Add your job(s) to the job table * job_id: an INT you can choose * state: an indication of how frequently the collection will occur, in minutes; must be 1 or greater to run at all * zombie_head: an INT, you'll use this to identify the head when you call TwitterGoggles * since_id_str: can be blank for new jobs * query: the "q=params" part of a Twitter Search Query (see https://dev.twitter.com/docs/using-search) * description: a note to yourself about what this job does, will print in verbose mode * last_count: NULL for new jobs * last_run: NULL for new jobs * analysis_state: 0 for new jobs * oauth_id: set to match the ID of the oauth credentials you just added * EXAMPLE:
INSERT INTO \`job\` (\`job_id\`, \`state\`, \`zombie_head\`, \`since_id_str\`, \`query\`, \`description\`, \`last_count\`, \`last_run\`, \`analysis_state\`, \`oauth_id\`) VALUES (3, 1, 2, X'30', 'q=from%3Alibbyh%20OR%20from%3Asgoggins', 'Libby\'s example job', NULL, NULL, 0, 1);

Usage

usage: TwitterGoggles.py [-h] [-v] [-d DELAY] head

positional arguments:
  head                  Specify the head # (zombie_head in the job table)

optional arguments:
  -h, --help            Show this help message and exit
  -v, --verbose         Show additional logs
  -d DELAY, --delay DELAY
                        Delay execution by DELAY seconds

Unix Cron Example

*/1 * * * * /usr/local/bin/python3 /home/TwitterGoggles.py -v -d 2 1 >> ~/log/zombielog-head-1-1.txt
*/1 * * * * /usr/local/bin/python3 /home/TwitterGoggles.py -v -d 17 2 >> ~/log/zombie-head-2-1.txt
*/1 * * * * /usr/local/bin/python3 /home/TwitterGoggles.py -v -d 33 3 >> ~/log/zombielog-head-3-1.txt
*/1 * * * * /usr/local/bin/python3 /home/TwitterGoggles.py -v -d 47 4 >> ~/log/zombielog-head-4-1.txt

twittergoggles's People

Contributors

libbyh avatar pmaconi avatar sgoggins avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.