Skip to content

Instantly share code, notes, and snippets.

@schrobby
schrobby / puzzle3-w3w.py
Created May 29, 2023 16:57
Scrape w3w data for 3-word permutations of given input
#!/usr/bin/env python
import requests
import time
import sys
import csv
from itertools import permutations
from flatten_dict import flatten
api_key = 'API-KEY'
@schrobby
schrobby / nightbot_top5.js
Last active January 27, 2024 18:28
Nightbot command that returns the top 5 players from Sink Race #4
$(eval r=$(urlfetch json https://keepthescore.com/api/xckjgssgfkzlr/board/); s = ''; c = 0; for (p of r.players) {if (c >= 5) break; c++; s += `${p.name} (${p.score}) — `}; s)
@schrobby
schrobby / nightbot_score.js
Created January 27, 2024 18:09
Nightbot command to fetch score of <player> !score <player
$(eval r=$(urlfetch json https://keepthescore.com/api/xckjgssgfkzlr/board/); s = r.players.filter(p => p.name.toLowerCase().includes(`$(1)`.toLowerCase()))[0]; `${s.name} currently have ${s.score} points.`)
@schrobby
schrobby / Program.cs
Created July 13, 2024 03:47
Told you, Dagger.
private void AddSongToQueue(string trackUri)
{
if (string.IsNullOrEmpty(accessToken))
{
GD.Print("Access token not available. Authenticate.");
return;
}
var queueUrl = $"https://api.spotify.com/v1/me/player/queue?uri={Uri.EscapeDataString(trackUri)}";
var headers = new[]