-
Clone repo:
git clone https://github.com/acm-uiuc/groot-meme-service cd groot-meme-service
-
Install dependencies:
pip install -r requirements.txt
-
Copy settings template:
cd groot_meme_service cp settings.template.py settings.py
-
Add your DB credentials to settings.py.
python groot_meme_service/app.py
Do export MEME_DEBUG=True
to run Flask in debug mode, if desired.
For the purposes of groot-meme-service
'admin access' is granted to members of the ACM admin, corporate, and top4 committees, as given by groot-group-service
.
NOTE: All routes require a HTTP Header called Meme-Token
which must be set to a valid user session token.
Returns paginated memes in given order.
Params:
author
- Optional. Filter by user who submitted meme.order
- Optional.- Options:
- 'latest' - freshest memes first
- 'random' - random order
- 'top' - memes sorted by number of votes descending
- 'hottest' - memes sorted by number of votes ranked by recency
- 'unapproved' - Requires admin access. Returns unapproved memes in ascending order by upload time.
- Default: 'latest'
- Options:
Registers a new meme.
Params:
url
- Required. Imgur url of the meme image. Must reference a valid imgur image (not a imgur gallery or album). Duplicate images are not allowed.title
- Optional. Title of your meme.
Returns the requested meme.
Requires admin access. Deletes a meme.
Requires admin access. Approves a meme to be publicly viewable.
Register a vote for the given meme. Vote type can be any of the following:
- like
- laugh
- sad
- angry
- wow Request
{
"vote_type": "like"
}
Retract a vote for the given meme.
Contributions to groot-meme-service
are welcomed!
- Fork the repo.
- Create a new feature branch.
- Add your feature / make your changes.
- Install pep8 and run
pep8 *.py
in the root project directory to lint your changes. Fix any linting errors. - Create a PR.
- ???
- Profit.