Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was bored, and I wanted to play with the API, so I came up with this little script:

It's coded in Python and has only a single image dependency.

Here is a screenshot:


Here's the source code (it's tiny, so I have no reason to host it on an external site):

import urllib, gzip, cStringIO, simplejson, pynotify, gtk

url = '' # I would change this, unless you want to monitor my account ;)
connection = urllib.urlopen(url)
response =

info = simplejson.load(gzip.GzipFile(fileobj=cStringIO.StringIO(response)))['users'][0]


message = pynotify.Notification("Stack Overflow", "Reputation: " + str(info['reputation']) + "\n" +
                                                  "Number of questions: " + str(info['question_count']) + "\n" +
                                                  "Number of answers: " + str(info['answer_count']) + "\n" +
                                                  "Number of up votes: " + str(info['up_vote_count']) + "\n" +
                                                  "Number of down votes: " + str(info['down_vote_count']) + "\n" +
                                                  "Accept rate: " + str(info['accept_rate']) + "%")


And here's the image the script would be looking for:

The icon

As it took me a while to figure out the JSON and API part, I might make a Python API for this, just for fun.

Any suggestions are welcome (don't worry, I will make this thing a bit more versatile)!

share|improve this question
You can pull the logo dynamically as icon_url via (though you should cache it). – Kevin Montrose Dec 1 '10 at 6:57
Thanks! I'll try that, but I'm not sure if I can pass it as an argument directly into the script. I think I'll have to download it first... – Blender Dec 1 '10 at 15:09
Try taking a look at StackApplet to see how I implemented image caching in Python using the API. – Nathan Osman Dec 2 '10 at 1:42
Dumb question but why do you need this ... gzip.GzipFile(fileobj=cStringIO.StringIO(response)) – PhilGo20 Jan 15 '11 at 20:39
It's a bit hard to explain, but the response is sent compressed. It's compressed with Gzip, and a quick one-liner is to treat the output as a pseudo-file and "unzip" it. It took me a while to figure out... – Blender Jan 17 '11 at 5:04

You must log in to answer this question.

Browse other questions tagged .