This script checks every 10 (by default) minutes and notifies you if you have new issues on NationStates.
This only works on Windows 10 as it uses win10toast to notify you of new issues - that could be changed though if anyone is sufficiently interested.
- win10toast - display toast notifications
- requests - make HTTP requests to the nationstates API
- beautifulsoup - parsing the xml returned from the API(probably a bit overkill, but it works)
- lxml - required for beautifulsoup to parse XML
- Download the script and install dependencies.
- Fill in the
NATION_NAME
constant with the name of your NS nation, with spaces replaced with underscores. - Fill in the
AUTOLOGIN
constant with the autologin (encrypted password) of your nation, which can be obtained as explained below. - (Optional) Change the
TIME_TO_WAIT
constant to the amount of time, in minutes, you want the script to wait before checking to see whether you have new issues. - Run the script. You may want to make it run automatically on startup.
Run something like the following:
curl -H "X-Password: YOUR NATIONSTATES PASSWORD HERE" -A "YOUR NATION NAME" -D - "https://www.nationstates.net/cgi-bin/api.cgi?nation=NATION_NAME_WITH_UNDERSCORES&q=ping"
or an equivalent using another https request tool. Note down the value of the x-autologin
header in the response. This is your autologin string.
- If you are logged in to NationStates in a browser and are active at the time this script makes a request, it may get an error because the two sessions conflict.
- No validation is done to ensure the authentication details you provide are valid.