View Full Version : UNOFFICIAL Weasyl Notification Application

07-17-2014, 08:22 PM
Hey fluffs. :3

Before I begin, I'd like to reiterate, this application is not an official Weasyl application, and I'm not pretending like it is, so please don't accuse me of lying about the officialness of this application!

So anyways, Over the last week or so, I've been learning how to use the Weasyl API to make an application of my own, mostly to kill time, but whatever.

So I started to spit out this or that little application, and eventually I began development on the main desktop application. A few hours later, poof. Done.


The counter under the log in name will add all of the notifications for each of the notification types, and the counter in the title will do so also, making it possible for you to minimize the application and still be notified without having to unminimize the application.

How it works:

When you first run it, you will be greeted with a command prompt (or terminal for us Linux and OS X users), which will be asking for your API key. You can set up a new API key here (https://www.weasyl.com/control/apikeys). Copy the key that Weasyl generates for you, and paste it into the application. You will then be asked for a delay for the automatic updating, in seconds. I recommend 30 or 60, but it depends on your preference.

After that, it will save the two things you just gave it to a file on your hard drive, under the file name ~/.weasylkey.api on Mac OS X/Linux, or C:\Users\\.weasylkey.api on Windows. This API key will not go anywhere else, except for RAM when you load the program.

When it is finished saving the API key and preferred delay length, it will validate your log in information by connecting to the api/whoami page on Weasyl. If the application gets a response code of 200 (completed with no errors), then you're marked as logged in.

It will grab your username from the previously downloaded information, then it will also ask Weasyl for the URL to your avatar, which it will then download as .avatar.png. When it's done with that, it will ask Weasyl for all of your notification information, which it will then parse from the given JSON information, and will lay out on the GUI window. It will also tally up your total notification number, which will be put below your username and in parentheses on the window title.

In the background, it will start a thread that will automatically check for new notifications every n seconds (n being the delay number you gave it).

When you start the program for a second time, it will skip asking for your API key and delay, and will go right to the verification process. It will redownload your avatar, which has it's pluses and minuses, but I don't think I'll be changing that, unless people would like me to.
Privacy notice:

This application connects to Weasyl through a secure connection (the aforementioned HTTPS). When you give it your API key, it will keep it on the hard drive only. It will only transmit the API key as a header to Weasyl, in order to identify you for requests. This application will not connect to any other HTTP server or any server online at all. Unless your computer is infected with a virus that intercepts upward data, your API key is safe. And remember, you can always remove your API key, which will make it immediately unusable. If you suspect that someone (or something) has hijacked your Weasyl account, remove your API keys and change your password. People with your API key cannot see your password, but it's still a good measure if you suspect a hijacking. This application will not make any changes to your Weasyl account. Analyzing the source code is not only allowed, but encouraged, to build trust in the application and the creator.

How to use:

When you download the PY file, open it in Python. You can do this in Windows by double-clicking the PY file, or in Mac OS X/Linux by opening a terminal, navigating to the folder it is in, and typing python WeasylApp.py.

You will need:

Python 2.7.6 (https://www.python.org/download/releases/2.7.6/) (not Python 3)
Requests module (http://docs.python-requests.org/en/latest/) (pip install requests on Linux/OS X, or follow link)
Tkinter module (installation option on Windows or run apt-get install python-tk or equivalent on Linux/OS X)
Pillow module (https://pypi.python.org/pypi/Pillow)


You can download the script on GitHub. Click here to go to the project page. (https://github.com/silvahwuff/WeasylApp) Click the "Download ZIP" link on the bottom-right, then extract the ZIP. The main GUI program is the WeasylApp.py. If you would like a command-line version, go to the Extras folder and run the Commandline.py file.


The license under which these files are released allows for the use, copying, editing and distributing of the script or any related files, at no cost, and with only the restriction that you must give credit to the original creator.


Code: Sil (https://www.weasyl.com/~sil)
Interface: Sil (https://www.weasyl.com/~sil)
Weasyl API documentation: Weykent (https://www.weasyl.com/~weykent)
Serious amount of assistance: Syfaro (https://www.weasyl.com/~syfaro), Weykent (https://www.weasyl.com/~weykent)

Oh, and my icon was made by Sirod (https://www.weasyl.com/~sirod). :3

Let me know of any bugs or issues you guys have with it, or any suggestions you've got. Enjoy! :3

01-10-2015, 09:14 PM
This look really cool. ^^

01-12-2015, 04:24 PM
It's a nice idea, I don't get enough notifications to need something to update me on them but I can see the applicability.
Does your program do Toast notifications? It might be an interesting option to consider.