Service to send information about Weather in Asturias using Twitter's tweets.
- AEMET API: it's an API REST service for meteorology data from Spain
- ASTURIAS-WEAHTER-BOT-GATHER: microservice to request forecasting and municipality data
- ASTURIAS-WEATHER-BOT-API: microserive to manage CRUD operations
- DATABASE: storages data of forecastings and municipalities
- ASTURIAS-WEATHER-BOT-SENDER: microservice to create tweets about forecasting and munipality data
Software requited to run this project:
- Git
- NodeJS v10.16.0
- NPM v6.14.5
- Nodemon (optional)
- PM2 (optional)
- Clone the repo and navigate to the workspace folder:
git clone https://github.com/IgnacioRubio/asturias-weather-bot-sender.git
cd asturias-weather-bot-sender
- Install project dependencies
npm install
- Create and set up environment variables into .env file
echo > .env
DB_URL_API=localhost:3000
TW_CONSUMER_KEY=N7ShYAp4jOJ1EOzJ7xbiNJ8nr
TW_CONSUMER_SECRET=2k5f9ozwmFSHnNUOxj2tO9mCixeTztT7d7zNGkv7CQkNTEr7zu
TW_TOKEN_KEY=1264627332020686850-a9BOzp90s1Oo9SvUfhSa4EeIPy8tGY
TW_TOKEN_SECRET=MbxGdoC7eXpVOp71U0Nc4vhK5h6MmH1sR4K4fBQAZupcF
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=465
EMAIL_AUTH_USER=example@example.com
EMAIL_AUTH_PASS=example123
EMAIL_MSG_FROM=exmaple@example.com
EMAIL_MSG_TO=example@example.com
- Run SENDER service
npm start
asturias-weather-bot-sender
├── index.js
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
└── src
├── services
│ ├── email.js
│ └── forecasting.js
├── util
│ └── env.js
└── var
└── state-skies-emojis.js
PM2 is used to make the deployment.
- Run package.json script
npm run pm2
- List service
pm2 list
- Restart service after update
pm2 restart awb-sender
- Stop service
pm2 stop awb-sender
- NodeJS - JavaScript runtime
- Express - Web application framework
- nodemailer - Easy as cake e-mail sending
- node-schedule - A cron-like and not-cron-like job scheduler
- node-emoji - Simple emoji support
- twitter - Twitter API client library
- dotenv - Storing configuration in the environment
This project is licensed under the MIT License - see the LICENSE.md file for details