The redditIWidget is an iWidget that shows if the user has any comments, private messages, or moderator mail. It also shows the current Comment and Link Karma. In order to use this iWidget, you must have iWidget installed, and a server running Python 2.7 that can be accessed whenever you want the iWidget to be updated.
When a message is present, the Reddit alien icon changes to show a picture of him holding an orangered envelope. In addition, there will be a count of the number of messages, preceded by the initial for the type of message ('C' for comment reply, 'P' for Private Message, 'M' for mod mail). Only the relevant message type counts (those with a count greater than zero) will be shown.
Here is a sample of what it looks like when a message is present:
http://i.imgur.com/bmfdaS4.jpg
Normally, the karma counts are shown in white. However, if the count changed, then the color of the number will change. When the count increases, the color will change to orange (the color of an upvote). When the count decreases, the color will change to blue (the color of a downvote).
In order for the widget to operate, it needs to be able to get the necessary data from Reddit (current message and karma counts). However, iWidget doesn't provide a platform that allows widgets to directly perform these types of queries from Reddit, since Reddit requires the user to be logged in to get their comment counts (FYI - message counts are available as semi-private RSS feeds). So, in order to get the necessary data, another server must be running that is able to do the heavy lifting, that the widget can query for an update.
To do this, I chose to take advantage of PRAW, which provides a very simple interface to authenticate with Reddit with OAuth. Once the server is authenticated with Reddit, the iWidget can simply make a request to the server for an update. The server will ask Reddit for the necessary data, parse the JSON and repackage as simple XML and send it to the iWidget to be displayed on the phone.
The server can theoretically handle multiple Reddit accounts at once (the point of using the database to hold the data), though I have only barely tested this. I do want to thank the PRAW developers, since they were very quick to fix a caching bug I came across in their package.
[Packages]
[Database]
[How to Configure the Server]
[Loading Code to iPhone]
[Using the Widget]
Wiki: Database
Wiki: How to Configure the Server
Wiki: Loading Code to iPhone
Wiki: Packages
Wiki: Using the Widget