Fetches a random question from a set of specific companies and difficulties
Requires Leetcode premium session token
URL of the problem is output to console and/or posted as message to a discord webhook
cargo run --package leetcode_scraper --bin bootstrap -- --companies company1 company2 --difficulties difficulty1 difficulty2
Companies:
--companies
As per the request made in the graphql request for fetching problems for a company (Eg: https://leetcode.com/company/google/)
Difficulties:
--difficulties
One of Easy, Medium or Hard
cargo run --package leetcode_scraper --bin bootstrap -- --companies google facebook --difficulties Easy Medium
The value for leetcode session can be found in the cookie stored (The last key: LEETCODE_SESSION)
export LEETCODE_SESSION=value
Create a discord webhook for the specific channel and set the following variable
export DISCORD_WEBHOOK_URL_KEY=value
Set the following environment variable:
export RUN_MODE="AWS_LAMBDA"
Building the zip for lambda:
docker run --rm -v $PWD:/code -v $HOME/.cargo/registry:/root/.cargo/registry -v $HOME/.cargo.git:/root/.cargo/git rustserverless/lambda-rust
Deploy lambda on AWS and set Rule using schedule entries (cron)