This is small project I put together to help my friends get their pre-order of the Playstation 5 before its release date. The initial demand was crazy and people were scrambling so I built this tool to give my friends a hand.
The code is written in typescript but is then compiled into plain javascript to deploy on gcp
Make sure you have node,npm and typescript installed. I developed this on a Mac so there instructions are just for Mac OS
brew install node@10 # Will install node and npm
npm install #Will install the packages you need
There's two files you need to update in order to get the emailer to work correctly.
.env.yaml
file that includes your email address and password you will use to send your notifications. This isn't tracked by git so you will need to create the file
email=name@domain.co.uk
password=password
Here's a brief intro about what a developer must do in order to start developing the project further:
git clone https://github.com/ShahnurIslam/ps5_scraper
npm install
npm start #to run the scraper
npm build #Will compile the code into javascript in the directory build
To dockerise and run the container
docker build -t ps5_scraper . #Builds the image
docker run ps5_scraper # run the scraper
You can run all these commands locally to get this deployed to GCP but you'll need the gcloud sdk installed which can be done from here
You'll then need a project setup on GCP and billing setup as well as the below enabled
Set your project in the terminal:
gcloud config set project <project name>
gcloud pubsub topics create scrapr
gcloud scheduler jobs create pubsub trigger-bot --schedule= 40 16 * * * --topic=scrapr
"If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome."
If there's anything else the developer needs to know (e.g. the code style
guide), you should link it here. If there's a lot of things to take into
consideration, it is common to separate this section to its own file called
CONTRIBUTING.md
(or similar). If so, you should say that it exists here.
Even though this information can be found inside the project on machine-readable format like in a .json file, it's good to include a summary of most useful links to humans using your project. You can include links like:
"The code in this project is licensed under MIT license."