diff --git a/README.md b/README.md index 584541c3577ad56a106f0d521fad496e3b6799a8..d15be70206f7af4c65a414e2fccc647ddafcf827 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,42 @@ This Twitter bot replies to tweets from [@xkcdComic](https://twitter.com/xkcdComic) with the alt text of the most recent XKCD comic. -### Example +## Example  -## Implementation +## Building and Running the Bot -This bot will run on the [Heroku](https://www.heroku.com/) platform. More details are coming soon! +This bot is designed to run on [Heroku](https://www.heroku.com/), but it should work on other cloud platforms, and can even run on your computer. -## Contributing and Forks +### General Instructions (Start here.) + +Download the latest version of the bot as a ```.zip``` file [here], and extract it to your preferred folder. + +Obtain your Twitter API and access keys [here](https://developer.twitter.com). Then, change the respective names of the environmental variables on lines 137-140 of [the program](xkcd_alt.py) in this format: + +```python +key = [os.environ.get('YOUR_API_KEY_HERE_ALL CAPS', None), + os.environ.get('YOUR_API_SECRET_KEY_HERE_ALL_CAPS', None), + os.environ.get('YOUR_ACCESS_TOKEN_HERE_ALL_CAPS', None), + os.environ.get('YOUR_ACCESS_SECRET_TOKEN_HERE_ALL_CAPS', None)] +``` + +Make all other modifications to the accounts you would like to interact with, and the formatting of your tweets. ([The official Twitter documentation is quite helpful for formatting.](https://developer.twitter.com/en/docs)) + +### --> Running on a PC + +*This bot requires access to your environmental variables. The computer also needs to have [Python](https://www.python.org/) installed. Modify these steps as needed for macOS and Linux.* + +You will need the [Requests](http://www.python-requests.org/en/latest/), [Requests-OAuthlib](https://requests-oauthlib.readthedocs.io/en/latest/), and [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) libraries. If you have [Pipenv](https://pipenv.readthedocs.io/en/latest/), you can install them by running the command ```pipenv install``` inside the folder; otherwise, run ```pip install -r requirements.txt```. + +Add your API keys and access tokens to your environmental variables by following [these instructions](https://java.com/en/download/help/path.xml). Then, just run ```python xkcd_alt.py``` in your command line and let it run! The bot respects the Twitter API limits, and will run every 60 seconds as long as the command line is open. + +### --> Running on Heroku + +Details are coming soon! + +## Forks and Contributing Feel free to fork this project and modify it for your own Twitter bot. (The license can be found [here](LICENSE).) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..3802cb9d9071d435f6c089b2330fca4b10c69a49 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +beautifulsoup4==4.6.3 +bs4==0.0.1 +certifi==2018.10.15 +chardet==3.0.4 +idna==2.7 +oauthlib==2.1.0 +requests-oauthlib==1.0.0 +requests==2.20.1 +urllib3==1.24.1 \ No newline at end of file