NATION

PASSWORD

Delegate endorsement checking script

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Merni
Ambassador
 
Posts: 1135
Founded: May 03, 2016
Democratic Socialists

Delegate endorsement checking script

Postby Merni » Fri May 01, 2020 2:18 am

Now on Github: here

This is just a simple Python script to check who isn't endorsing a delegate. It supports command-line arguments, so can be automated. It uses just 4 API queries, regardless of the size of the region. Made this because there wasn't another tool that I could find here.

Source: download "endo.py" from Github.

Syntax for CL arguments:
usage: endo.py [-h] [-r REGION] [-u USERAGENT]

optional arguments:
-h, --help show this help message and exit
-r REGION, --region REGION
Region name
-u USERAGENT, --useragent USERAGENT
User agent

Note that if your region name or useragent has a space, you will have to "enclose it in double quotes" (on Windows at least)

If no CL arguments are given, the user is prompted to enter these details.

Sample output:
C:\Users\Admin>py .\Appdata\Local\Programs\Python\Python36\endo.py -r "The Labyrinth" -u "Merni endo check"
Querying nations in region...
Querying WA members...
Finding intersection...
Querying delegate...
Querying delegate endorsements...
Finding difference...




===============WA Delegate endorsement report===============
Generated (begin) on: 2020-05-01 at 09:15:32 UTC
Region: The Labyrinth
WA Delegate: greater_victora
Nations: 239
WA nations: 67
WA Delegate endorsements: 38
WA nations not endorsing: 28
% of WA nations endorsing: 56.71641791044776
% of WA nations not endorsing: 41.7910447761194
Note: WA delegate not included in calculations
============================List============================
1 the_boris_isles
2 the_aro_homeland
3 darcov
4 doctriniumn
5 marj_al-hamam
6 drewask
7 wadiya_aladeen_the_third
8 con_ins_lallakerscak
9 shane_dawson_and_the_theorist_community
10 crusaders789
11 le_epico
12 veen_republic
13 antonieo
14 the_europea_commonwealth
15 borlotins
16 swizzleland
17 mekonn
18 fritzlands
19 nihil-land
20 neo-gallia
21 kiratic_sireion
22 1kish4jk
23 wulfingland
24 montelana
25 wheres_my_uncle
26 manchoo
27 limingia
28 anglands
Press Enter to close...

C:\Users\Admin>

Without CL arguments:
C:\Users\Admin>py .\Appdata\Local\Programs\Python\Python36\endo.py
Your useragent should have your email/NS name, as well as the purpose of this program (endo check). The mods need this info.
Enter your useragent : Merni : endo check
Enter your region name : The Labyrinth
then same as above
Last edited by Merni on Mon Jun 01, 2020 10:17 am, edited 4 times in total.
COVID19 still exists! | Free time? Help Gutenberg!
The Labyrinth | GA Committee List | Tools written by me | NS Parliament 2: Zhang Xiaoqing
I've noticed that everybody that is for abortion has already been born. — Ronald Reagan

When the people are being beaten with a stick, they are not much happier if it is called 'the People’s Stick.' — Mikhail Bakunin (to Karl Marx)

You're supposed to be employing the arts of diplomacy, not the ruddy great thumping sledgehammers of diplomacy. — Ardchoille

The West won the world not by the superiority of its ideas or values or religion [...] but rather by its superiority in applying organised violence. — Samuel P. Huntington (even he said that!)

Compass E:-7.75 S:-3.64

User avatar
Aurum Raider
Spokesperson
 
Posts: 190
Founded: Sep 18, 2014
Iron Fist Consumerists

Postby Aurum Raider » Fri May 01, 2020 6:02 am

This is a very well written and concise script, nice :clap:
Atagait Vytherov-Denral, Supreme Doggo of An Incidentally Hazardous Area
Raider Purist | Your Region's Persona Inesistente


Return to Technical

Who is online

Users browsing this forum: Alsweria, Ballotonia, Devionsa, Grishahakkaverchynot

Advertisement

Remove ads