A Node.js application that scraps posts off of Bikozulu's blog and sends them to users subscribed to a Telegram bot.
- Getting started
- Prerequisites
- Installing
- Running the app
- Deployment
- Built With
- Authors
- License
- Acknowledgments
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You will need these to run and set up the app
- A firebase account.
- Node.js installed on your PC
-
Clone or download the repo from this url and extract it.
-
Open your console and change into that directory
cd javascript-web-scraper/
-
List the contents of the directory.
ls
-
You should have such a directory structure
javascript-web-scraper/ └── functions/ │ ├── index.js │ │── ... │ │── ... │ └── package.json |── firebase.json |── .gitignore |── firestore.rules |── ... |── ... |── index.js └── package.json
-
Install the required modules
npm install
-
Install the required modules for cloud functions
cd functions/ npm install
-
Create a
.env
file at the root of your directory and add the following variables:API_KEY: "", AUTH_DOMAIN: "", DATABASE_URL: "", PROJECT_ID: "", STORAGE_BUCKET: "", MESSAGING_SENDING_ID: "", APP_ID: "", MEASUREMENT_ID: ""
-
Sign into your console and open the app you created. Get the config object for your web app and copy-paste the details into the respective fields in yout
.env
file. Follow this tutorial if you have trouble getting them. -
Retrieve your Javascript SDK for firebase and copy it to the root of your project. Use this tutorial.
-
Rename the firebase admin credentials that you have just downloaded to
firebase-adminsdk.json
The app is split into two parts;
- A web scraping application that scraps data and stores it in Cloud firestore
- Cloud functions that are triggered and run when updating the Telegram bot.
- From the root(
/
) directory, runnpm run start
- You should see such a screen
Yaay! It works.
- Navigate into your
functions/
directorycd functions/
- Run
npm run serve
That's it
cd
into the root/
directory# If you are in the functions directory cd ../
- run
firebase deploy
Currently accepting pull requests.
- Lewis Munyi - Dev - Website
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License v3.0 License - see the LICENSE file for details
Enjoy 🤘