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.
Install / Use
/learn @pmaconi/TwitterGogglesREADME
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.
Version Notes
libbyh/TwitterGoggles is now on version 2.0. It is no longer compatible with pmaconi/TwitterGoggles because of changes to the schema and the data stored (this version captures account creation date). If you update your version of TwitterGoggles.py, you must also use the updated database schema. You can update your current schema using config/update_schema_v2.sql.
Recent Changes
- added account created_at date to db and script so we know how old these Twitter accounts are
- additional indexes in config/schema.sql to speed up queries
- allow user to choose a settings file - use case: run a single TwitterGoggles codebase that populates more than one database
- allow user to cache/store JSON returned before parsing into MySQL - use case: you really love keeping "raw" data or you want to parse it differently later
- see related project for analyzing data collected/parsed by TwitterGoggles: Analyze Tweets from TG
Dependencies
- mysql-connector-python
- requests
- requests-oauthlib
Setup and Installation
- 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 - Install the dependencies
- Make sure you have "pip" installed on your system (this is a package manager for Python3)
- From a command prompt, type:
pip install mysql-connector-python requests requests-oauthlib
-
if pip is not installed, issue these commands:
wget http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#md5=62a9f08dd5dc69d76734568a6c040508tar -xvf pip*.gzcd pip*sudo python setup.py install -
Build database
- Create empty database
- Create new user for db or grant access to an existing user
- Run config/schema.sql
-
Set database (and optional: JSON file storage) config settings (see config/example_settings.cfg)
-
Save that file as config/settings.cfg (or something else and use the
-sarg when you call the script) -
Add your OAuth credentials to the oauth table
- Get OAuth credentials by setting up an Application at Twitter's Developers site
- EXAMPLE:
Usage
usage: TwitterGoggles.py [-h] [-v] [-d DELAY] [-c CACHE] [-s SETTINGS] 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 execution by DELAY seconds
-c, --cache Cache the JSON returned before parsing it into MySQL
-s, --settings Full path to the settings config file with MySQL and Data param
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
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
