Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phette23/epheme
making Twitter ever so slightly less ephemeral
https://github.com/phette23/epheme
Last synced: 27 days ago
JSON representation
making Twitter ever so slightly less ephemeral
- Host: GitHub
- URL: https://github.com/phette23/epheme
- Owner: phette23
- Created: 2014-09-26T03:38:51.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-19T23:45:52.000Z (almost 10 years ago)
- Last Synced: 2024-04-14T23:15:24.469Z (7 months ago)
- Language: Python
- Size: 230 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# epheme
Small archiving project using [twarc](https://github.com/edsu/twarc) & MongoDB to retain Twitter metadata & download native (not linked) images.
```
usage: epheme.py [-h] [-i IMAGES] [-d DATABASE] textpositional arguments:
text string to use in the Twitter search APIoptional arguments:
-h, --help show this help message and exit
-i IMAGES, --images IMAGES
directory to place downloaded images in
-d DATABASE, --database DATABASE
name of database to store JSON in
```Images directory defaults to "img". Database defaults to the search text with spaces replaced by underscores (e.g. "#search_term").
The functionality built on top of twarc is modest but I'm specifically interested in grabbing images from Twitter. Setting epheme to run regularly (e.g. with cron) lets me continually archive search results, related images, & use mongo's API to display them. There's a small example included here.
## Setup
Requires virtualenv & mongodb. On a Mac with homebrew, you can get these with `sudo pip install virtualenv; brew install mongodb`.
```sh
# set up virtual env in the project root, activate, install dependencies
virtualenv .
source bin/activate
pip install -r requirements.txt
# set OAUTH keys for Twitter in shell ENV
export CONSUMER_KEY abcdefgh12345678abcedefgh
# same for CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET…
# start mongo, run daemon in the background
# the included config file isn't necessary, just a convenience
mongod --config mongod.conf &
```## To Do
- [x] example - use mongo REST API to display wall of images
- [ ] logging of some sort? Can always pipe output to a file## License
CC0 Public Domain