dev pfp
dev
@photoshop.eth
Alright... time to write the script that calculates the Sunday raffle winners! ...will try to break it down slowly in the thread 🧵
14 replies
15 recasts
22 reactions

dev pfp
dev
@photoshop.eth
First of all... to view the raffle thread and all the entries I'm using @super because @warpcast hides some of the comments.
1 reply
1 recast
1 reaction

dev pfp
dev
@photoshop.eth
Then I inspect the DOM to find the list of entries and check that it matches the reply count (at the moment 508)
1 reply
1 recast
1 reaction

dev pfp
dev
@photoshop.eth
Getting a random entry is easy with the random node select script we've used before, but this time we need to add some extra entries for user who gave tips
1 reply
0 recast
0 reaction

dev pfp
dev
@photoshop.eth
Now the cast HTML structure is a bit funky on Supercast so to get the winner name we have to use a querySelector "a a + a a" and build the entry mapping with inital entries of 1 (the free entry)
1 reply
0 recast
0 reaction