-
6 votes
-
Celsius crypto bank freezes withdrawals; bitcoin, etherium plunge
12 votes -
Rumors abound that Netflix will buy Roku
6 votes -
Why the bezzle matters to the economy
6 votes -
TV Tuesdays Free Talk
Have you watched any TV shows recently you want to discuss? Any shows you want to recommend or are hyped about? Feel free to discuss anything here. Please just try to provide fair warning of...
Have you watched any TV shows recently you want to discuss? Any shows you want to recommend or are hyped about? Feel free to discuss anything here.
Please just try to provide fair warning of spoilers if you can.
4 votes -
Texas school shooting kills nineteen children, two adults
38 votes -
Email client K-9 Mail will become Thunderbird for Android
10 votes -
Iamamiwhoami – Call My Name (2022)
2 votes -
Pioneerball - Sea of Moscow (2018)
2 votes -
Book review: The Dawn Of Everything
2 votes -
What did you do this week (and weekend)?
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their week. Did you accomplish any goals? Suffer a failure? Do...
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their week. Did you accomplish any goals? Suffer a failure? Do nothing at all? Tell us about it!
10 votes -
Lords complain of ‘poor wine’ and ‘too much salmon’ in the ‘disappointing’ taxpayer-subsidised food and drink served to Parliament
14 votes -
Everything Everything - Bad Friday (2022)
2 votes -
Canadian Prime Minister Justin Trudeau isolating after testing positive for COVID-19 again
5 votes -
The Helios microkernel
10 votes -
K-9 Mail to become Thunderbird on Android
8 votes -
The Google engineer who thinks the company’s AI has come to life
17 votes -
What games have you been playing, and what's your opinion on them?
What have you been playing lately? Discussion about video games and board games are both welcome. Please don't just make a list of titles, give some thoughts about the game(s) as well.
15 votes -
In defense of crypto(currency)
6 votes -
The Floppotron 3.0 - Computer Hardware Orchestra
2 votes -
We are (almost) halfway through the year. How is 2022 going for you?
I'd like to know how you're all doing. Did you have any goals for this year? Have you achieved any of them? Given up on any of them? What are the top 3 things that changed in your life so far this...
I'd like to know how you're all doing. Did you have any goals for this year? Have you achieved any of them? Given up on any of them? What are the top 3 things that changed in your life so far this year?
16 votes -
Weekly US politics news and updates thread - week of June 13
This thread is posted weekly - please try to post all relevant US political content in here, such as news, updates, opinion articles, etc. Extremely significant events may warrant a separate...
This thread is posted weekly - please try to post all relevant US political content in here, such as news, updates, opinion articles, etc. Extremely significant events may warrant a separate topic, but almost all should be posted in here.
This is an inherently political thread; please try to avoid antagonistic arguments and bickering matches. Comment threads that devolve into unproductive arguments may be removed so that the overall topic is able to continue.
3 votes -
Is LaMDA Sentient? - An Interview
5 votes -
Hate crime investigation underway after alleged Proud Boys storm Drag Queen Story Hour at Bay Area library
5 votes -
Marcus Ericsson powered through contact with his teammate to finish second in the Grand Prix of Road America – regains IndyCar points lead over Will Power
4 votes -
Weekly coronavirus-related chat, questions, and minor updates - week of June 13
This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the...
This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the situation is like where you live!
2 votes -
Every new trailer from the Xbox & Bethesda Games Showcase 2022
7 votes -
Foone reverse engineering SkiFree, one function at a time
@foone: OKAY SKIFREEThis is a game originally from 1991, developed by Chris Pirih, and included on one of the Windows Entertainment Packs. There's a modern 32bit version by the original developer, on the official site:https://t.co/Yoj7PDmkcV pic.twitter.com/ETQa1wdqqR
8 votes -
In Iceland, traditionally a land of cat lovers, bans and curfews are redefining the human relationship with domestic cats
7 votes -
Continued drop in EU’s greenhouse gas emissions confirms achievement of 2020 target
4 votes -
When did you first realize you were different?
Interpret “different” in whatever way you like, for whatever context you like. Tell us your story. When did you realize it? What was it like? What did you feel? What came of it?
14 votes -
Adolescents in the US are chronically sleep-deprived, in part because most schools start too early. This summer, California will become the first state in the nation to require later start times.
24 votes -
What happened to giant hovercraft?
5 votes -
Racing an excavator to save this house’s wood from landfill
6 votes -
Python Loops for JSON
How the heck do these work? I've cobbled together the script below for my bot (using Limnoria) to return the F1 standings in a line. Right now it returns the first value perfectly, but I can't...
How the heck do these work? I've cobbled together the script below for my bot (using Limnoria) to return the F1 standings in a line. Right now it returns the first value perfectly, but I can't figure out the loop to get the other drivers at all.
The script
import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutils import supybot.callbacks as callbacks import supybot.ircmsgs as ircmsgs import requests import os import collections import json try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization("F1") except ImportError: _ = lambda x: x class F1(callbacks.Plugin): """Uses API to retrieve information""" threaded = True def f1(self, irc, msg, args): """ F1 Standings """ channel = msg.args[0] data = requests.get("https://ergast.com/api/f1/2022/driverStandings.json") data = json.loads(data.content)["MRData"]["StandingsTable"]["StandingsLists"][0]["DriverStandings"][0] name = data["Driver"]["code"] position = data["positionText"].zfill(2) points = data["points"] output = ", ".join(['\x0306\x02' + name + '\x0303' + " [" + position + ", "+ points + "]"]) irc.reply(output) result = wrap(f1) Class = F1
The output should be
VER [1, 125], LEC [2, 116], PER [3, 110], RUS [4, 84], SAI [5, 83], HAM [6, 50], NOR [7, 48], BOT [8, 40], OCO [9, 30], MAG [10, 15], RIC [11, 11], TSU [12, 11], ALO [13, 10], GAS [14, 6], VET [15, 5], ALB [16, 3], STR [17, 2], ZHO [18, 1], MSC [19, 0], HUL [20, 0], LAT [21, 0]
...but it only returns
VER [1, 125]
I'm in that state where I can read the stuff, but when I put it together, it doesn't always work.
Final script
# this accepts @champ or @constructor with an optional year # and also @gp with an optional race number for the current season import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutils import supybot.callbacks as callbacks import supybot.ircmsgs as ircmsgs import requests import os import collections import json try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization("F1") except ImportError: _ = lambda x: x class F1(callbacks.Plugin): """Uses API to retrieve information""" threaded = True def champ(self, irc, msg, args, year): """<year> Call standings by year F1 Standings """ data = requests.get("https://ergast.com/api/f1/current/driverStandings.json") if year: data = requests.get( "https://ergast.com/api/f1/%s/driverStandings.json" % (year) ) driver_standings = json.loads(data.content)["MRData"]["StandingsTable"][ "StandingsLists" ][0]["DriverStandings"] string_segments = [] for driver in driver_standings: name = driver["Driver"]["code"] position = driver["positionText"] points = driver["points"] string_segments.append(f"\x035{name}\x0F {points}") irc.reply(", ".join(string_segments)) champ = wrap(champ, [optional("int")]) def gp(self, irc, msg, args, race): """<year> Call standings by year F1 Standings """ data = requests.get("https://ergast.com/api/f1/current/last/results.json") if race: data = requests.get( "https://ergast.com/api/f1/current/%s/results.json" % (race) ) driver_result = json.loads(data.content)["MRData"]["RaceTable"]["Races"][0][ "Results" ] string_segments = [] for driver in driver_result: name = driver["Driver"]["code"] position = driver["positionText"] points = driver["points"] string_segments.append(f"{position} \x035{name}\x0F {points}") irc.reply(", ".join(string_segments)) gp = wrap(gp, [optional("int")]) def constructor(self, irc, msg, args, year): """<year> Call standings by year F1 Standings """ data = requests.get( "https://ergast.com/api/f1/current/constructorStandings.json" ) if year: data = requests.get( "https://ergast.com/api/f1/current/constructorStandings.json" % (year) ) driver_result = json.loads(data.content)["MRData"]["StandingsTable"][ "StandingsLists" ][0]["ConstructorStandings"] string_segments = [] for driver in driver_result: name = driver["Constructor"]["name"] position = driver["positionText"] points = driver["points"] string_segments.append(f"{position} \x035{name}\x0F {points}") irc.reply(", ".join(string_segments)) constructor = wrap(constructor, [optional("int")]) Class = F1
3 votes -
Erling Haaland scored two goals and made another as Norway thumped neighbours Sweden 3-2 in their UEFA Nations League clash
4 votes -
A few more things added to Steam Deck
9 votes -
gron - Make JSON greppable
7 votes -
Short-sightedness has become an epidemic
7 votes -
Chasing the treasure fox
2 votes -
Elon Musk’s regulatory woes mount as US moves closer to recalling Tesla’s self-driving software
10 votes -
Microsoft trying to kill HDD boot drives by 2023: Report
8 votes -
How to turn your images into paint-by-number templates: The five best free sites
2 votes -
Sunsetting the Atom text editor
6 votes -
Queer Games Bundle 2022
8 votes -
Judge blocks Texas investigating families of trans youth
18 votes -
Finland and Russia share more than 800 miles of land border, plus the archipelago sea – a photo journey through the border zone
4 votes -
Trader Joe's workers in Massachusetts file to create chain's first union
16 votes -
AlbumLove recommendations thread: June 2022
Choose one album that you love that you think deserves more love Tell us what it is, and why. Previous posts in series Additional Details What is this? It's a new post series I'm trying out! Each...
Choose one album
that you love
that you think deserves more loveTell us what it is, and why.
Additional Details
What is this?
It's a new post series I'm trying out! Each month people can use the AlbumLove thread to post an album they love and explore those posted by others.
I'm planning to put up a new AlbumLove thread on the first of each month for a few months to see how these go as a trial run. If people like it we can keep it going — if they don’t it’ll fizzle out and I’ll stop.
Why AlbumLove?
In this day and age, algorithmic recommendations for music are easy to come by, and it's trivial to seek out new music that interests you by searching online. AlbumLove offers an opportunity to sift through music loved by others, including those who might have divergent tastes from you. Think of this as an opportunity to listen outside of your comfort zone, with music that you know someone else adores, from a small pool of thoughtful hand-selected options.
What do I post?
Any album that you love and that you feel deserves more appreciation. There are no restrictions on genre, year, or anything else, and nothing is “too popular” or “too niche”. If you think it needs more love — for whatever reason — then it’s welcome in AlbumLove.
Name the artist and the album, and then, most importantly, share what you love about the album. It could be the music itself, but it could also be your associations with it -- maybe the album reminds you of someone you love, or you saw the band live and got a new appreciation for the studio songs.
Also, commenting on others' recommendations is encouraged! If you love something that someone else shared, let them know!
Do I have to listen to what everyone else posts?
Nope. You don't have to listen to anything if you don't want to. This is about creating a menu of options that people can explore as they wish.
Can I post more than one album in a month?
Nope. Limit one! This helps us be more selective about what we choose, as well as preventing the threads from getting flooded with too many contributions to keep track of.
Why albums and not songs/artists?
I like albums. :)
Seriously though, I feel like it's a very different thing to like an album as a whole versus a few songs or just an artist's general vibe. I like the idea of quantizing music for appreciation in the same way we might do with books or movies.
What about EPs?
Fair game!
5 votes -
Do you think an ~engineering group would make sense?
I think it would, that's something that interests a vast number of users. Things like construction, bridges, buildings, city planning, trains, etc. Right now they can go to ~misc or ~design which...
I think it would, that's something that interests a vast number of users. Things like construction, bridges, buildings, city planning, trains, etc. Right now they can go to ~misc or ~design which doesn't seem appropriate.
5 votes