Skip to content

Instantly share code, notes, and snippets.

@chrisjbillington
Created July 25, 2023 20:41
Show Gist options
  • Save chrisjbillington/260114bf0d0ad99127ae53de64308a72 to your computer and use it in GitHub Desktop.
Save chrisjbillington/260114bf0d0ad99127ae53de64308a72 to your computer and use it in GitHub Desktop.
Script to list manifold users with streaks ≥ 200
import json
import time
from datetime import datetime
from pathlib import Path
import requests
def get_all_users():
url = "https://manifold.markets/api/v0/users"
users = []
while True:
params = {'limit': 1000}
if users:
params['before'] = users[-1]['id']
more_users = json.loads(requests.get(url, params=params, timeout=30).text)
users += more_users
print(f"got {len(users)} users")
if not more_users:
return users
time.sleep(0.5)
# cache users for today to avoid redownloading
USERS_FILE = Path(f'users-{datetime.now():%Y-%m-%d}.json')
try:
users = json.loads(USERS_FILE.read_text('utf8'))
except FileNotFoundError:
users = get_all_users()
USERS_FILE.write_text(json.dumps(users), 'utf8')
streakers = []
for user in users:
streak = user.get('currentBettingStreak')
isbot = user['isBot']
if not isbot and streak and streak >= 200:
streakers.append((streak, user['username']))
streakers.sort()
for streak, username in streakers[::-1]:
print(streak, username)
print(len(streakers), "users with streaks ≥ 200")
344 jack
342 SG
342 MartinRandall
341 egroj
341 FranklinBaldo
340 Chocobo
339 Predictor
336 SneakySly
323 ScottLawrence
322 NcyRocks
316 BoltonBailey
310 citrinitas
307 Conflux
281 JoshuaB
281 BTE
278 Ivan
269 zzq
263 Zardoru
261 NicoDelon
260 A
257 DavidMathers
256 omnishambles
256 RSWats
255 Gabrielle
253 UFTG
253 Agh
252 MarcusAbramovitch
251 XComhghall
250 wadimiusz
250 na_pewno
248 xCrimson
248 harfe
248 OrbiterVoltron
248 NexVeridian
246 Rocks
245 lisamarsh
242 GoodGrief
240 YourHero
240 Tripping
239 nickten
239 PunishedFurry
238 MattReardon
238 Duncn
237 JeffreyHeninger
235 DavidKochanov
235 AndrewG
231 kenakofer
226 RJPerez
222 Samin
221 Fion
220 NathanNguyen
220 Lovre
220 Dustin
219 kottsiek
215 CourierSix
215 AllanLacy
214 JesusDeSivar
213 firstuserhere
212 jonsimon
211 StrayClimb
211 MaxPayne
211 Gen
211 EugenGrue
211 AaronLehmann
210 asmith
209 x
209 Odoacre
209 JonathanRay
207 QuantumObserver
206 howtodowtle
206 SuperTaxGenius
206 HenriThunberg
205 Renz
205 PhillyBol
205 Kronopath
204 chrisjbillington
204 MartinModrak
204 Khorosho
204 DmitryBushev
201 galen
80 users with streaks ≥ 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment