Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 0 additions & 232 deletions .ipynb_checkpoints/NeotomaTwitterBot-checkpoint.ipynb

This file was deleted.

11 changes: 11 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Goring"
given-names: "Simon"
orcid: "https://orcid.org/0000-0002-2700-4605"
title: "Neotoma Twitter Bot"
version: 2.0
date-released: 2021-10-20
doi: 10.5281/zenodo.5587213
url: "https://github.com/NeotomaDB/NeotomaBot"
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or
imagery, derogatory comments or personal attacks, trolling, public or private harassment,
insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(http://contributor-covenant.org), version 1.0.0, available at
http://contributor-covenant.org/version/1/0/0/
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
worker: python neotomabot.py
worker: python3 neotomabot.py
47 changes: 30 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
NeotomaBot
==========
# NeotomaBot

by: Simon Goring
<!-- badges: start -->

May 4, 2015
[![Lifecycle: archived](https://img.shields.io/badge/Lifecycle-archived-orange.svg)](https://neotomadb.org)
[![DOI](https://zenodo.org/badge/417625973.svg)](https://zenodo.org/badge/latestdoi/417625973)
[![NSF-1948926](https://img.shields.io/badge/NSF-1948926-blue.svg)](https://nsf.gov/awardsearch/showAward?AWD_ID=1948926)

<!-- badges: end -->

Description
----------------------
A twitter bot to search for new records in the [Neotoma Paleoecology Database](http://neotomadb.org) and then post them to the [@neotomadb](http://twitter.com/neotomadb) Twitter account.

This program was an experiment to see how good my Python programming skills are. Apparently they're okay. The code could probably use some cleaning, but I'm generally happy with the way it turned out.

The program runs on a free [Heroku](https://heroku.com) dyno and tweets semi-regularly.

Requirements
-----------------------------
The program uses `tweepy`, `time`, `sys`, `json`, `requests`, `random` and `imp` package for Python, as well as the Neotoma [API](http://api.neotomadb.org/doc/about). It was coded in Notepad++ because I wanted to try to do it quickly.
![Neotoma Twitter Banner](resources/neotomatwitter.png)
## Contributors

This project is an open project, and contributions are welcome from any individual. All contributors to this project are bound by a [code of conduct](CODE_OF_CONDUCT.md). Please review and follow this code of conduct as part of your contribution.

* [Simon Goring](http://goring.org) [![orcid](https://img.shields.io/badge/orcid-0000--0002--2700--4605-brightgreen.svg)](https://orcid.org/0000-0002-2700-4605)

### Tips for Contributing

Issues and bug reports are always welcome. Code clean-up, and feature additions can be done either through pull requests to project forks or branches.

## Requirements

This application runs using Python v3. All required packages are listed in the [requirements.txt](requirements.txt) file, generated using the python package `pipreqs`.

Tweets are pulled either from the [resources/cannedtweets.txt](resources/cannedtweets.txt) or generated using the [Neotoma API](https://api.neotomadb.org) `/v1.5/data/recentuploads/n` endpoint. This endpoint returns a list of all dataset uploads within the last `n` months using an XML format.

The OAuth information is hidden on my computer and added to the `.gitignore`. If you want to run this yourself you'll need to go to the Twitter [apps](https://apps.twitter.com/) page and register a bot of your own. Once you get the `CONSUMER_KEY` and the other associated KEYs and SECRETs put them in a file called `apikeys.txt`. The code will work.
The application requires four environment variables, stored as configuration variables in the Heroku dynamo. These are the keys required to access the Twitter API. To obtain these keys for your own use you must add the [Developer status](https://developer.twitter.com) to your existing Twitter account and register an application to obtain the following keys:

Contributions and Bugs
----------------
This is a work in progress. I'd like to add some more functionality in the near future, for example, following and reposting any posts using the hashtag [`#neotomadb`](https://twitter.com/search?f=realtime&q=%23neotomadb), and posting links to articles using the Neotoma Database.
* CONSUMER_KEY
* CONSUMER_SECRET
* ACCESS_TOKEN_KEY
* ACCESS_TOKEN_SECRET

If you have any issues (about the program!), would like to fork the repository, or would like to help improve or add functionality please feel free to contribute.
### Running Locally

License
-------------------
This project is distributed under an [MIT](http://opensource.org/licenses/MIT) license.
It is possible to run this code locally if you have the environment variables set. Just run `python3 neotomabot.py`
Binary file removed c
Binary file not shown.
Loading