Skip to content

Instantly share code, notes, and snippets.

View MehediH's full-sized avatar
💥
doing the thing

Mehedi Hassan MehediH

💥
doing the thing
View GitHub Profile
@MehediH
MehediH / cazoo.js
Created November 21, 2021 20:09
cazoo cloudflare worker
const cazooApiUrl = "https://www.cazoo.co.uk/api/search?sort=createdAt-desc&runningCosts=ulezChargeExempt&fuelType=Petrol%2CElectric%2CPlug_in_Hybrid%2CHybrid&gearbox=Automatic&ownershipType=purchase&maxMonthlyPrice=280";
const discordWebhookUrl = "https://discord.com/api/webhooks/ENTER_YOUR_WEBHOOK"
/*
For this to work, you need to setup Workers KV https://developers.cloudflare.com/workers/runtime-apis/kv
Here, my KV namespace is called CAZOO
For the worker to actually get triggered, you'll also need to set up a cron job from the Workers UI in Cloudflare
*/
async function handleRequest() {
## testing
class Script:
def __init__(self, sid, mark):
self.sid = sid
self.mark = mark
s1 = Script(242, 22) # this
s2 = Script(243, 42) # this
s3 = Script(244, 21)