This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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) |