Initial commit.

This commit is contained in:
Abhay Rana 2013-11-28 00:47:16 +05:30
commit d371721bf3
2 changed files with 98 additions and 0 deletions

31 Normal file
View File

@ -0,0 +1,31 @@
HackerTray is a simple [Hacker News]( Linux application
that lets you view top HN stories in your System Tray. It relies on appindicator, so
it is not guaranteed to work on all systems.
The inspiration for this came from [Hacker Bar](, which is
Mac-only. I tried to port it to `node-webkit`, but had to do it in Python instead
because nw doesn't support AppIndicators yet.
1. Minimalist Approach to HN
2. Opens links in your default browser
3. Remembers which links you opened
4. Shows Points/Comment count in a simple format
- Reload data every 5 minutes
- Implement a way to remember which stories have been read
- Ideally app-memory should be persistent (save on disk)
- Auto Start
- Convert to a Python Module
- Add a menu separator between news and preferences.
##Author Information
- Abhay Rana <>
Licenced under the MIT Licence

67 Normal file
View File

@ -0,0 +1,67 @@
import pygtk
import gtk
import appindicator
import requests
import webbrowser
class HackerNewsApp:
def __init__(self):
self.ind = appindicator.Indicator ("Hacker Tray", "hacker-tray", appindicator.CATEGORY_APPLICATION_STATUS)
self.ind.set_status (appindicator.STATUS_ACTIVE)
# create a menu = gtk.Menu()
# create items for the menu - labels, checkboxes, radio buttons and images are supported:
btnRefresh = gtk.MenuItem("Refresh This")
btnRefresh.connect("activate", self.refresh)
btnQuit = gtk.MenuItem("Quit")
btnQuit.connect("activate", self.quit)
def quit(self, widget, data=None):
def open(self, widget, data=None):
def addItem(self, item):
i = gtk.CheckMenuItem("("+str(item['points']).zfill(3)+"/"+str(item['comments_count']).zfill(3)+") "+item['title'])
i.url = item['url']
def refresh(self, widget=None, data=None): = reversed(getHomePage()[0:15]);
for i in
for i in
def getHomePage():
r = requests.get('')
return r.json()
def main():
return 0
if __name__ == "__main__":
indicator = HackerNewsApp()