Build a bot that extracts the following from people’s Twitter bio (on public/open accounts), into a Google spreadsheet:
- Twitter profile name
- Number of followers
Target accounts using either of these criteria:
- Based on hashtags used
- Based on number of followers; Between 1,000 - 50,000
The bot is suppose to maintain a session and continously listen to the predefined hashtag
- Python 3.6.2
- You need to set up the following to run the application successfully.
- Create a Twitter account in case you don't have one. https://twitter.com/signup
- Go to apps.twitter.com and click on 'Create New App ' button.
- Fill out the details of the form correctly.
- Then click on the ‘Create your Twitter application’ button.
- Replace the consumer key, consumer secret, access token and access token secret values with the ones you generate.
- Go to the Google API Console
- Create a new project
- Click Enable API. Search for and enable the Google Drive API.
- Create credentials for a service account to access Application data.
- Obtain OAuth2 credentials from Google Developers Console for google spreadsheet api and drive api
- Save the file as client_secret.json in same directory as project.
- Look up this link https://pygsheets.readthedocs.io/en/latest/authorizing.html for more information on Authorizing pygsheets
- Ensure you install all project dependencies
pip install -r requirements.txt
- Run Test
python -m unittest tests.test_bot tests.test_spreadsheets
- Run application
python bot.py