Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rpidanny/nietzsche
Scrap quotes from Goodreads and schedule random tweets.
https://github.com/rpidanny/nietzsche
aws aws-lambda cloudformation goodreads goodreads-quotes iac infrastructure-as-code nietzsche quotes serverless
Last synced: 18 days ago
JSON representation
Scrap quotes from Goodreads and schedule random tweets.
- Host: GitHub
- URL: https://github.com/rpidanny/nietzsche
- Owner: rpidanny
- License: mit
- Created: 2019-01-17T21:54:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T06:24:43.000Z (about 1 year ago)
- Last Synced: 2024-10-11T18:56:56.932Z (about 1 month ago)
- Topics: aws, aws-lambda, cloudformation, goodreads, goodreads-quotes, iac, infrastructure-as-code, nietzsche, quotes, serverless
- Language: JavaScript
- Homepage: https://twitter.com/TolleZitate
- Size: 2.48 MB
- Stars: 49
- Watchers: 2
- Forks: 13
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nietzsche
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frpidanny%2FNietzsche.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Frpidanny%2FNietzsche?ref=badge_shield)A [Serverless](https://serverless.com) application that fetches quotes from [Goodreads](https://www.goodreads.com/quotes) and saves it to [DynamoDB](https://aws.amazon.com/dynamodb). _(About 88K+ unique quotes)_
It also includes:
1. Quotes Search API
2. Tweet Quotes## Architecture
### High Level Block Diagram
![logo](./architecture.png "Architecture Diagram")
### Quote Tweet State Machine
![logo](./statemachine.png "Architecture Diagram")
## Requirements
1. [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)
2. [Serverless](https://serverless.com)## Setup
1. Get [Twitter API keys](https://developer.twitter.com/en/apps)
2. `aws ssm put-parameter --name nietzsche-twitter-consumer-secret --type String --value $CONSUMER_SECRET --profile default --overwrite --region eu-west-1`
3. `aws ssm put-parameter --name nietzsche-twitter-consumer-key --type String --value $CONSUMER_KEY --profile default --overwrite --region eu-west-1`
4. `aws ssm put-parameter --name nietzsche-twitter-access-token --type String --value $ACCESS_TOKEN --profile default --overwrite --region eu-west-1`
5. `aws ssm put-parameter --name nietzsche-twitter-access-token-secret --type String --value $ACCESS_TOKEN_SECRET --profile default --overwrite --region eu-west-1`
6. `npm i`### Getting Access Token
1. Set `TWITTER_API_KEY` and `TWITTER_API_KEY_SECRET` in your environment variable.
2. Run `node scripts/get-access-token.js`## Deploy
`npm run deploy`
## Invoke
### Start Quotes Scrapping Job
`serverless invoke -f dispatchScrappers --stage prod`
### Tweet Random Quote
`serverless invoke stepf --name tweetQuoteStateMachine --stage prod`
## Contribute
Help make this app better and future proof.
- Clone the code
- Install the dependencies with `npm install`
- Create a feature branch `git checkout -b new_feature`
- Lint with standard `npm run lint`## License
This software is released under the MIT license. See [the license file](LICENSE) for more details.