«1234567»
Lodged | From | Messages | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The King of All Wild Things | Yeah, that's a good point. There are lots of cereals that are better dry. Chocolate Os for example. Yum! | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | It's time to play the music! I'm happy to say that I've completed this Muppet Show card collection. | ||||||||||||||||||||||||||||||||||||||||||||
Wild panther | Fantastic collection. Fun idea for a puppet region. Looking through all of those cards brings back so many memories! Lots of characters in there that I'd completely forgotten about. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | |||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Oh - guess I should leave a copy of the magazine here _ TWO CENTS Woosh! Another year of inactivity just flew by. Which is why I'm partly responsible for the demise of NS Today. Real-life pressures and all that. Not that my real-life pressures are as ridiculous as this real-life story. While most of NS-related 2022 passed me by, I did manage to spot some technical happenings. And for those of you nervously watching out for snakes, that python is here. But if you're just thinking, "I don't care about any of this. Why did I get a notification?", then this section is for you. _ OLD NEWS Early in 2022 I'd taken on the role of Chief Content Officer with NS Today. It had been a promising start, with good ideas for articles, and keen writers working on stories. With editing, quality controls, and chasing up people to complete tasks, doing it properly was very like having a job. Which should have been fun. Except I already had a full time job. And that day job was getting more demanding. Sadly, real-life won out over NS (it pays better), and I had to step back from NS Today. I was far from being the glue that held NS Today together. The staff were all talented individuals who could continue perfectly well without me, as evidenced by Vulshine's third-in-the-series roleplay constitution article, and SkyGreen's piece on Sanctum. However, people committing less puts more pressure on the rest, making it more difficult for them to continue. And so gradually NS Today came to a halt. In November, Lewis (the co-founder, and the former Chairman and Chief Executive of NationStates Today) made this announcement on Discord: @Notifications After a review of the activity over the last 3 months, and following a warning I gave to the Board, I have decided to stop providing funding for the NationStates Today website. The annual cost to me is now over $80, which just isn't sustainable for a dormant project. I have generated a static backup version of the website, which is now permanently available here: https://nationstates.news/ NationStates Today should therefore be considered in a dormant state. Thank you for all of your support over the last few years. It's been fantastic. If anyone is interested in taking over the project, please send me a message. I have the archives of the website, etc. Thanks again :) _ RECYCLED NEWS You must have seen this in the mainstream press. But I loved this story, so I'm recycling it here. And if you're wondering what NSG thought, here's the place to start. _ REPEAL OR NO REPEAL? The premise for Repeal or No Repeal is pretty simple. A recently passed piece of legislation gets named, and you have to guess correctly as to whether it will be repealed before the end of the month. It's quite some time since Daarwyrth's legislation, Protections During Territorial Transitions passed with 64.9% in favour! I asked if it would get repealed before 1st October. Well, the legislation outlived Daarwyrth, who CTEd in December! Hopefully issues author Daarwyrth will be back with us at some point in the future. Tinhampton, Toonela, Large Ladz, The Orwell Society, St Saratoga, The North Polish Union, Voljundok, Daarwyrth, Aleixandria, Life empire, Mauryavarsha, Kanteen Click to see if we're running a poll. Need to vote some more? Check out your eligible polls. _ TECH TALK In Tech news, NationStates is catching up with the 21st century. Wait, what? NS was created in the 21st century? Huh. Who knew? Anyway... there's now an official NationStates Announcements Channel for Discord. This way we can get pinged with the information that NS is broken rather than discovering for ourselves when we try to log in. That's a massive step forward, right? Right? Talking of NS being broken, addicts were served some cold turkey for Christmas when the site went down. If you missed it, you'll be glad to know that photo-journalist Cataleenia had their camera handy and documented events. [WARNING: link contains full-frontal nudity of a moderator] Back in August, the site took on five new Technical Moderators, namely Chingis (who, iirc, was largely responsible for infecting NS with a nasty dose of crabs, and whose Buzzy Bee ensured that Lily got pollenated across hundreds of regions each update), Esternial (of P2TM fame), Racoda (notorious card-sharp and industrial farmer), Roavin (whose typical post in Technical contains more knowledge than my entire brain), and United Calanworie [Aav] (whose technical magic kept NS Today hanging together). Understandably these appointments caused some excitement (and possibly some overexcitement). Nearly everyone was positive about the news, except for one very weird threadjack. And while we've not seen much new yet the technical pipeline looks promising, with Aav letting us know suggestions for BBCode improvements are being looked at (and who wouldn't want those?), and Roavin gathering ideas of improvements that script authors would like to see.Ah yes. And script authors may wish to look away. Coming up next is what might be best described as a script crayon scribble! _ DISCUSS DISGUST You poured the last of your favourite cereal from the packet into your bowl. You took the milk out the fridge and poured that in too. Then you noticed the milk was out of date. The milk *smells* like it's OK. But is it? How long past the Use By Date could the milk be before you'd throw out this cereal? It's official - over half of us think that a morning sugar-rush outweighs the risk of an all-day toilet rush! Ejoland, Insane cookie browser, All Wild Things, Tiger 237, Aleixandria, Wild panther, Choccolate, Lower crimea, Natord dommaniaordia, Kharim, Jewish sealand, Vipru, The Hurricane, Doranbia, Happiville Click to see if we're running a poll. Need to vote some more? Check out your eligible polls. _ SNAKES AND HEADERS I've been intending to learn a bit about the Python coding language for a few years now. It's getting used more and more at my work, so it's potentially useful for me there. While I'm not entirely new to coding (I learned a bit of Visual Basic on the job, and have played with Javascript in the past), professional Javascript developers have seen my code - and despaired. I imagine anyone familiar with Python will similarly cringe at my attempts here. If that's you, look away now! What follows is not a guide on how to code Python. It's just a warts-and-all record of the terrible hacks I'm doing to make some stuff work with NationStates. To start, I visited https://www.python.org/downloads/, and downloaded Python 3.11.1 (the latest version) onto my Windows laptop. The download included a basic development environment, and that's what I've been using to write some code. There will be much better IDEs out there that are free to download and use, but this one will do me for now. After acing the traditional "hello world" project, I thought I'd move on to an NS themed script. Why do anything inbetween, right? NationStates has strict rules about how our code / scripts can interact with it. Keep to those rules. They're linked from the Technical forum, and can be found with the API documentation: pages/api.html. For my first NS Python project, I thought I'd keep it simple, and make a single API request to get some data about my nation. It could have been simple. It should have been simple. But I found a way to complicate it. It started off not too bad. From the NS API documentation, I easily figured out that the URL that would return my nation info was cgi-bin/api.cgi?nation=all_wild_things. Google told me that the "requests" Python module would allow me to make an API call. So I needed to install that module. I opened a command prompt, and typed "pip install requests". Astoundingly, it worked first time, and installed the module. So I then copied some example code from the net into a new Python script, and modified it to make it work for me: import requests def fMain(): objResponse = requests.get( 'https://www.nationstates.net/cgi-bin/api.cgi?nation=all_wild_things', headers={"User-Agent": "smalldickenergy@getalife.com"} ) print("Status:", objResponse.status_code) print("Headers:", objResponse.headers) print("Text:", objResponse.text) fMain() The "requests.get" command opens up a connection to NS, sends my headers, assigns the response to my "objResponse" variable, then closes the connection again. I can then work with different properties of objResponse. NS asks that API users include a User-Agent in the headers so that they can contact you if your script is messing with the site. If you use this code, make sure you change the User-Agent to your own email address, and not Greta's. The script outputs three attributes of objResponse. "Status" is the HTTP status code. If the API request works properly, I should get status code 200 back, indicating a success. If ever there's a problem with the API request, the status code should help indicate what went wrong. "Headers" are meta-info that NS has sent back about the API request. And "Text" is the XML data that I requested. It's worth noting some of the coding habits that were beaten into me in the past. Different languages have different conventions. I generally ignore them, and stick with what I was taught. The function is called "fMain" instead of just "Main". The small-case "f" is a reminder that this is the name of a function. Similarly the variable "objResponse" gets prefix "obj" to indicate that it's some sort of object. I use variable name prefixes such as "int" for integers, "str" for string etc. This isn't recommended by Python, it's just what I do. In Python, you can change a variable's type from integer to string etc, so this habit may well backfire if I need to do something like set intRowNumber = "John". The code worked. It brought back the data I wanted it to. Yes, the output format looked like garbage, but finessing that is a job for another day. So I reckoned that was a win. Except that the API call was synchronous. Which needs an explanation. With a synchronous request, NS gets asked for the data. And nothing else happens until the data is returned and it gets processed. With an asynchronous request, NS gets asked for the data, the code can do some other stuff, and then when the data gets returned it gets processed. For a simple script like this, it makes no difference. And since NS is rate-limited to 50 API calls per 30 seconds, it probably makes little difference even for more complex code. But being bloody-minded, I wanted to figure it out. And figuring out how to do that was a bit of a headache. I don't remember if I had to install the asyncio module, but I definitely needed to install aiohttp ("pip install aiohttp"). Then after much staring at examples, and trial-and-error, I came up with this code: import aiohttp import asyncio async def fGet(objSession, strUrl, dictHeaders): async with objSession.get(strUrl, headers=dictHeaders) as objResponse: return objResponse.status, objResponse.headers, await objResponse.text() async def fMain(): async with aiohttp.ClientSession("https://www.nationstates.net") as objSession: intStatus, objHeaders, strText = await fGet( objSession, "/cgi-bin/api.cgi?nation=all_wild_things", {"User-Agent": "smalldickenergy@getalife.com"} ) print("status: ", intStatus) print("headers: ", objHeaders) print("text: ", strText) asyncio.run(fMain()) That's a lot more code for the same output. In this one, function fMain creates an object objSession. This is the thing that connects to NS. Unlike the "requests" module, this can keep the connection open, which in theory makes it more efficient for making multiple requests. But I suspect that due to the rate limit, this won't improve any NS code performance. I also specified the base NS URL when defining objSession. It doesn't actually need specified at this point, but apparently it makes the thing even more efficient. And when I call my fGet function, I only need to send the second part of the long URL I'm wanting the data from. I've got a separate function, fGet, which actually sends my URL and headers to NS and retrieves the data. The "status" and "headers" get sent back by NS almost straight away. The "text" takes a little longer, which is why the "await objResponse.text()" is needed. Because the information comes back at different times, this is possibly where a few milliseconds of efficiency gains can be made - the status & headers can get processed while waiting on the text. But I'll see what I can do with that another time. _ NOTIFICATIONS You will have received a notification if you have been mentioned somewhere in this dispatch, and have a tick in the "Dispatch mention" box of your subscriptions page. Almost all nations mentioned will have: If you would prefer not to be notified in future, your choices are: But hopefully you enjoyed this dispatch, and don't mind the ping. Thanks for subscribing! Aleixandria, Davelands, Indusse, Jeeves Land, Napaqaq, Of Altonianic Islands, Pathoal, Ricore, Sky point, St Saratoga, The Georgeian Empire, The Orwell Society But what I actually came on to post were these balloon animals. Yeah, I know... https://www.theguardian.com/artanddesign/gallery/2023/jan/07/balloon-animals-beyond-the-poodle-in-pictures | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Hmm. Python project ideas. Maybe a Cards related one? You can get the API to show you the bids and asks that a nation has. <CARDS> <ASKS> <ASK> <ASK_PRICE>0.05</ASK_PRICE> <CARDID>4685708</CARDID> <NAME>Meiru Melusine</NAME> <SEASON>3</SEASON> <TIME_PLACED>1672488152</TIME_PLACED> </ASK> <ASK> <ASK_PRICE>0.10</ASK_PRICE> <CARDID>4951148</CARDID> <NAME>Aya Shameimaru-</NAME> <SEASON>3</SEASON> <TIME_PLACED>1673461848</TIME_PLACED> </ASK> </ASKS> <BIDS/> </CARDS> There's a forum thread that you're allowed to use to advertise cards for sale. It must be possible to write a helpful python script. The script couldn't post to the forum (against site rules), but it could write the text, which would then be manually posted. I have a number of puppets that are selling cards. So I could use the API to find all the cards I have Asks on. The API returns the name, card ID, season, ask price, and a timestamp. So the output could be a list of nation names (hyperlinked to the card's page using the card ID and season), with a note of the ask price. Like this: [URL=https://www.nationstates.net/page=deck/card=4685708/season=3]Meiru Melusine[/URL], 0.05 Meiru Melusine, 0.05 Or maybe in a table for neatness. With an extra API call per card, you can get some additional info, like rarity, and market value. <CARD> <CARDID>4685708</CARDID> <CATEGORY>common</CATEGORY> <FLAG>uploads/meiru_melusine__326074.png</FLAG> <GOVT>Inoffensive Centrist Democracy</GOVT> <MARKET_VALUE>0.01</MARKET_VALUE> <NAME>Meiru Melusine</NAME> <OWNERS> <OWNER>nomomo</OWNER> ... <OWNER>endryu</OWNER> </OWNERS> <REGION>A Bloodred Moon</REGION> <SEASON>3</SEASON> <SLOGAN>God, Homeland, Liberty</SLOGAN> <TYPE>Republic</TYPE> </CARD> That could be a nice extra. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | And of course, a bot that posted WILD LIFE to embassy RMBs could be handy. I made an RMB bot in the past, but the code got lost when my last laptop died. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | I've figured out the easy bit for the Cards project, which is the formatting of the API results. Get my Future,0.10 The next challenge is to run this for multiple puppets, while staying in the Rate Limit. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Awesome history dispatch complied by Libertia-Columbia: Table of Contents The Brotherhood of Blood (TBoB) The Brotherhood of Malice (BoM) The Founderless Regions Alliance (FRA) The Order of the Grey Wardens (TGW) The Land of Kings and Emperors (LKE) Great Britain and Ireland (GB&I) All Frontiers and Frontierist Ideology Libertarian Socialist Confederation (LSC) The Social Liberal Union (SLU) Democratic Socialist Union (DSU) You can help out by suggesting additional history resources for me to add to this dispatch! Feel free to TG me any of these resources. I am also specifically looking for resources on the following, which would be very helpful and greatly appreciated if TG'd to me.
The Compendium: The NationStates History Book The Library of Spurned Knowledge History of NationStates NS History: You've Got Questions, We've Got Answers NS Gameplay History Death & Denial: NationStates In Its Twentieth Year The Reference Library NS History Resources Rhetoric, Ideology and Propaganda: The Good, the Fun, and the Ugly Newspapers can be useful resources for uncovering past historical events on NationStates, as well as the perspectives of players surrounding those events. Note that this section only contains newspapers which directly address NS gameplay, and does not contain newspapers only addressing roleplay, IRL politics, NS cards, or other non-GP activity. The NewsStand International NS News (archived) NS Today The Gameplay Magazine The Rejected Times The Northern Lights The North Star The Red Standard (archive) Europeian Broadcasting Corporation (EBC) The Wolfist Tribune WILD LIFE (archive) Curious Observations The Drewpocalypse: A Retrospective 2004 NationStates Global Summit on Raiderplay and Defensive Operations Defenders Coup Stargate BoM in Balder: Operation Ragnorak TNP Blackmail Scandal: As It Unfolded Passed General Assembly Resolutions Passed Security Council Resolutions Condemning The Communist Bloc: A Recurrent Bad Idea World Assembly Trends History of The Pacifics How Should You Govern a Super-Region? The Pacific (TP/NPO) The Extended Guide, Part Two: The New Pacific Order The Anatomy of the Coup: How Francos Spain Won NS Gameplay History Early Chronology of The Pacific's Delegacy, Pre-Francos Francos Spain's Autobiographical Account of the History of The Pacific Historically Significant Documents Proper Francoist Thought The Great Pacifican Lie Principles and Politics The North Pacific (TNP) Anatomy of the Coup II: Attack of the Puppets (The Invasion of The North Pacific) List of TNP Delegates NS Gameplay History Explanation of the 2008 TNP Coup Series About International NS Politics (TNP, LAZ, TRR, TEP) TNP Blackmail Scandal: As It Unfolded Historically Significant Documents The Independent Manifesto On Alignment Statement On Continued Interregional Peace Taking A Stand The South Pacific (TSP) Laws of The South Pacific List of delegates of the South Pacific List of prime ministers of the South Pacific Online Rulings Consultation System The East Pacific (TEP) Anatomy of the Coup III: TEP, the Early Days The Story of the East Pacific The Fedele Coup Portraits of Delegates Series About International NS Politics (TNP, LAZ, TRR, TEP) History of the Imperial Occupation of The East Pacific Two Wars in TEP? Historically Significant Documents The West Pacific (TWP) The History of the West Pacific Index of the Delegates of The West Pacific History of the Delegacy of The West Pacific Short Lived West Pacific Dominion Crumbles! The West Pacific Falls! Hypocrisy in the Feeders - Part One Lazarus (LAZ) Record of Delegates Record of Delegates by Era List of Speakers of the Assembly Series About International NS Politics (TNP, LAZ, TRR, TEP) Den Takes Lazarus Q&A With Spec, Former Lazarene Delegate Osiris (OSI/OFO) Osiran Body of Records Osiris, Government Records Osiris, Pharaohship Records Something Stirs: The History of Early Balder & Osiris Osiris: Past and Future - Observations and Inferences on Regional Dynamics Banjecting Biyah and Destroying Dali: The Story of Operation Phoenix Historical Delegates, Vice Delegates and Statsministers of Balder Something Stirs: The History of Early Balder & Osiris The Rejected Realms (TRR) The Library of Spurned Knowledge List of Governments of the Rejected Realms Military Blunders: Nationstates Series About International NS Politics (TNP, LAZ, TRR, TEP) Early Chronology of TRR's Delegacy Europeia-TRR Spying Incident: As It Unfolded A Warzone History, through Dispatches The History of the DEN The Official DEN History Book Historically Significant Documents Den Takes Lazarus The Brotherhood of Blood (TBoB) TBoB History Known TBoB Conquests History of the Brotherhood of Blood (along with FRA) The Black Hawks (TBH) The History of The Black Hawks The History of The Black Hawks The Brotherhood of Malice (BoM) The Unofficial History of The Brotherhood of Malice Lone Wolves United (LWU) A Brief Introduction to LWU LWU History Lone Wolves United's Year In Review of 2022 Historically Significant Documents The Founderless Regions Alliance (FRA) History of the Founderless Regions Alliance (along with TBoB) The League (TL/LDF) Lawbook of the Republic Prohibitions Issued by The League The League Wiki Page Consular Library of Precedents, Opinions, Interpretations, and Et Cetera A brief history of Concord Commemorating the Battle of Concord The Order of the Grey Wardens (TGW) Hall of Historical Wardens Significant Operations Record (The Big Ops List) 10000 Islands (XKI/TITO) Headfirst Dive: XKI History Early History of TITO XKI Historical Archive Index Historic Voter Turnout in the 10000 Islands History of Counter-Invasions in TITO (Draft) Lily Hall of Fame Imperialism: Past and Present Historically Significant Documents The Land of Kings and Emperors (LKE) Emperors of The LKE Crown Princes and Princes Imperial of The LKE Imperialism: Past and Present The New Inquisition (TNI) Historical Officials of The New Inquisition
Historically Significant Documents General Elections Electrify Region! All Frontiers and Frontierist Ideology On True Frontiers On Wastelands Coming soon... Coming soon... The Communist Bloc (TCB) List of Regional Leaders of The Communist Bloc TCB Legislative Committee Records The Red Standard Archive Condemning The Communist Bloc: A Recurrent Bad Idea Historical RMB Activity Historically Significant Documents The Case for Bloc Patriotism Anti-Fascism in the Frontiers: Why? On Declinement Europe: A History History of Europe Welcome to Europe [url=https://www.google.com]Placeholder until I find a solution to this bug Compilation of Press Releases Europeia-TRR Spying Incident: As It Unfolded The Leftist Assembly (TLA) The Leftist Assembly History Project: Episode #1 - The Great Split The Leftist Assembly History Project: Episode #2 - The Rise and Fall of The Leftist Union The Leftist Assembly History Project: Episode #3 - The Final Horseman's Coup A Comprehensive History of The Leftist Assembly History of The Leftist Assembly (TLA Wiki) Historical RMB Activity Refugia Council Records Past Refugia Revised Statute Referendums Delegate Voting Records: Includes: Conch Kingdom, Lands End, Ridgefield, Cape of Good Hope History of the Augustin Alliance Historical Events in Conch Kingdom History of Cape of Good Hope Thaecia Law Registry Press Releases from Thaecia Thaecian Tribune Index Thaecia Population and WA Member Statistics History of Gay The Story of Christmas North Korea (NK) The abbreviated history of North Korea An abridged history of the Korean Peoples Army Libertarian Socialist Confederation (LSC) Guide to Elections in the LSC Cry of Rebellion - All Issues Dispatch Confederal Council - Activity Log N-Day 7: LSC Recap The Social Liberal Union (SLU) SLU List of Historical Periods The History of Capitalist Paradise, 2003-2010 General History of the Commonwealth Corrections to General History of the Commonwealth The Communist Region (TCR) Historical RMB Activity List of history-related resources Democratic Socialist Union (DSU) The Founding of The Democratic Socialist Union Federation of Anarchist Communes (FAC) FAC Archive Greater Sahara Legislation Master Reference Guide History of Greater Sahara - Lave Deldederady: The Tyrant Delegate Statement on Thwarted Invasion Attempt Operation Tenebrae Saharae: Dusk Falls on the Sahara More history to be added... | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Time to play some alternative Hunger Games! Thanks to Dear Leader's wise policies, the supermarket shelf is unusually well stocked. What's for dinner this week? You choose in this poll! | ||||||||||||||||||||||||||||||||||||||||||||
Wild panther | I weirdly really enjoy both pickled eggs and corned beef. But you can really only eat so much corned beef, given how salty it is. But I could toss down pickled eggs all day long. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | |||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | So I'm playing around with "sched" module in Python. But I'm not sure it's a practical solution. If I set a scheduler to fire off a request every 0.6 seconds, it wouldn't work. The reason for that is: say the first request gets delayed by a couple of microseconds on it's way to NS. Then NS is similarly delayed in registering the request for a couple of microseconds. And then when the 51st request gets registered at NS, it looks like it's less than 30 seconds since the first. So it would look to NS like the rate limit is being broken. A solution to that could be to record the timestamps when NS acknowledges that the requests have been sent. Then I can set a scheduler to send the 51st request exactly 30 seconds after NS acknowledged the 1st request. I think that's the maximum efficiency I can get. However... I'd send my first 50 requests 0.6 seconds apart, so that I had exactly 50 in 30 seconds. That's all good. So although I'd still be in the rate limit, the frequency of requests would get more and more messed up the more requests I made. Probably it's not an issue until you're into thousands of requests. But the efficiency of that method is probably only worth it for thousands of requests - after all, a 1 millisecond efficiency only becomes a 1 second efficiency after 1000 requests. If I was writing a high frequency trading algorithm for Goldman Sachs I'd keep on down this path. It would literally pay dividends! But for NS, I think I'm on a lost cause. I'm probably as well to go back to the vanilla "requests" module, and just block code execution for 0.6 seconds between requests. The code is then much more simple. Or maybe stick with the asynchronous version, but just force 0.6 seconds between requests. That way the time spent processing results of one request shouldn't delay sending out the next. Hmm. I guess that choice is based on how complex the result-processing code is. Wild panther and The Lake Lands | ||||||||||||||||||||||||||||||||||||||||||||
Wild panther | You are obligated to try corned beef once, as a loyal citizen of the empire. Those weirdly-shaped Libby's cans come with their own bespoke can opening device that is very unintuitive to use. Which is fun. And I can't stress enough just how salty this processed meat product is. Save it for a big breakfast after imbibing the night before, maybe in a hash or just as a side to a big ole greasy spread. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | After walking away from the asynchronous approach, this task became really simple. # Asks # Version 1.0 # All Wild Things # Finds all Asks offered by each of a list of nations, # and outputs a string representing an NS Forum table. # Takes approx 30 seconds for every 50 nations. import requests # allows synchronous http requests import xml.etree.ElementTree as ET # ElementTree allows XML to be parsed import time # allows "sleep" function def fMain(): # listNations lists all the nations whose "Asks" are to be found listNations = [ "All Wild Things", "All Mummified Things" ] # Start the string strOut = "[table]" # Loop through the nations for strNation in listNations: # re-format the nation name so it can be used in a url strNation = strNation.replace(" ", "_").lower() # send a request to NS objResponse = requests.get( 'https://www.nationstates.net/cgi-bin/api.cgi?q=cards+asksbids;nationname=' + strNation, headers={"User-Agent": "myaddress@gmail.com"} ) # Look at the "Asks" in the returned XML objAsks = ET.fromstring(objResponse.text).findall("./ASKS/ASK") # Loop through the cards with Asks for objAsk in objAsks: # Add details to the string - a link to the card page, the nation name, the ask price strOut = strOut + ("[tr][td][URL=https://www.nationstates.net/page=deck/card=" + objAsk.find("CARDID").text + "/season=" + objAsk.find("SEASON").text + "]" + objAsk.find("NAME").text + "[/URL][/td][td] " + objAsk.find("ASK_PRICE").text + "[/td][/tr]") # Rate limit is 50 requests per 30 seconds, so wait for 30 / 50 = 0.6 before next request time.sleep(0.6) # All nations have been checked, so output the string strOut = strOut + "[/table]" print(strOut) fMain() | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Really, no. I've eaten it in the distant past, and (probably) never again. My dad was one for eating it in a white roll with pickled beetroot. I'll admit to being like my dad in many ways, but in matters of gastronomy, no. My mum ate a lot of weird stuff. She grew up in 1950s UK when rationing was still on. So she remembers the excitement of getting things like fresh oranges and bananas. And her Canadian relatives sending treat food parcels - dried banana chips, pineapple, coconut... The type of stuff you get in your granola was her idea of Christmas. They kept a jar of dripping (if you grill bacon, and scrape the fat off the grill pan after, that's "dripping". I suspect it wasn't just bacon fat went into their dripping jar though). And a special treat after school would be a slice of bread with dripping smeared across. I tried it once. Just the once. That said, if you fried the bread in that bacon fat, I'm up for a second slice. Edit: lol - I just looked up a thing about corned beef. This was my favourite line: | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Accidentally came across this! I'm a fan Greetings, as I noticed that there wasn't really a proper Guide to the use of the most powerful design tool this website has, here is my tiny but hopefully helpful guide to the tabeling. First, let's start with what a table is: For the sake of presentation, and the code tag not working in Factbooks, I will deactivate the tags using Zero Width Non-Joiners, which are not depicted, but recognized by the site builder. Now, have I awakened yer' interest? I'll now start with the basics and go deeper from there. Now then, a table is created by using the Table tags [table][/table] and inside that, several Table rows with [tr][/tr] and inside those several table columns via [td][/td]. For example, a basic 3x3 table would look like this in code: [table] [tr][td]1[/td][td]2[/td][td]3[/td][/tr] [tr][td]4[/td][td]5[/td][td]6[/td][/tr] [tr][td]7[/td][td]8[/td][td]9[/td][/tr] [/table] Which would look like this:
Note that linebreaks inbetween the tags that aren't td are ignored, so they are useful in order to make it a bit more orderly to work with. Now, ye might wish that maybe the header at the beginning maybe wasn't there, or maybe that the table was entirely invisible and didn't highlight when you hover over it with the mouse?
And now the big ones, you remember the part where I talked about Layouting? This is achieved with the beloved tag that is [td]! The name of the way one can alter them is called span, both rowspan and colspan respectively, which allow you to make cells that stretch along the row and column. This is done by altering the tag like this[td=c2] for cells that span the column and [td=r2] for cells that span the row. Sadly, after my knowledge, making a cell that spans both rows and columns at the same time is currently not possible with NSBBcode. Note that the replaced tabs have to be removed from the other cells instead of getting overwritten. So, a 3x3 Table with Rowspan looks like this in code: [table=noheader] [tr][td=r3]1[/td][td]2[/td][td]3[/td][/tr] [tr][td]5[/td][td]6[/td][/tr] [tr][td]8[/td][td]9[/td][/tr] [/table] Which would look like this:
[table=noheader] [tr][td=c3]1[/td][/tr] [tr][td]4[/td][td]5[/td][td]6[/td][/tr] [tr][td]7[/td][td]8[/td][td]9[/td][/tr] [/table] Which would look like this:
However, these are ideally used with Table=Plain, as the highlighting is terribly buggy with rowspan employed, though for visualization the ones with highlighting are rather useful. With this tool, one is empowered to create truly wonderful factbooks with many layouts, however, there are some disadvantages with the Nationstates implementation, which I shall list now.
Now that is all about the Tables of NS. | ||||||||||||||||||||||||||||||||||||||||||||
Wild panther | Worry not, I definitely don't blame you :P Ah yes, the things we humans do during economic depression or otherwise tumultuous times... Because my grandparents grew up during the great depression, my father inherited much of their digested uncertainty, and so we wound up often eating in much the same way. Toast with "drippings" really struck a chord. We never kept a jar of it, though...that's actually not a bad idea. Pork fat does tend to make most things taste better. But we did often have toast with salted butter as a dessert. Another staple was either grits or creamed wheat, with butter and corn syrup over top. And yep, never take for granted fresh fruit. My grandfather taught me to eat the white fleshy underside of an orange peel after finishing the fruit, because supposedly there's good vitamins to be had in there. That's a great resource, thanks. Nice to see the rationale spelled out so clearly. I browsed through their other dispatches, and they're a very creative individual. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | "toast with salted butter as a dessert" | ||||||||||||||||||||||||||||||||||||||||||||
via The Embassy | The Oppressed Peoples of Lower Slobbovia | Subscribe, | |||||||||||||||||||||||||||||||||||||||||||
The Community of The Lake Lands | |||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Hello! Welcome to Where the Wild Things Are, where the burning question is: Nice to have you, but be warned that the posts won't always be intelligent, and that there be times when there are literally months between posts. Do you have other nations? It seems unusual for a brand new nation to move out here to the edge of the multiverse. | ||||||||||||||||||||||||||||||||||||||||||||
The Community of The Lake Lands | Yes, we have several nations. Another reason this region is so appealing. We may not get around very often, and we hate missing numerous RMB postings. | ||||||||||||||||||||||||||||||||||||||||||||
The King of All Wild Things | Thanks, that's kind of you. And nice of you to pop by! I'm amazed you find time in between all the embassy request clicking! Do you manage to visit many regions after the initial first contact? | ||||||||||||||||||||||||||||||||||||||||||||
via The Embassy | The Oppressed Peoples of Lower Slobbovia | We get around to the Regions of special interest to us, or with renowned Founders (Sometimes we even send a puppet like The Lake Lands). |