Command line Bloglines Notifier in Python

Another stupid script that I wrote as my latest attempt in procrastination. This Python script basically queries Bloglines for the number of unread items you have. A bit like notifiers that are already available on Windows and Mac, except on command line, where ever real man works :)

Interestingly Bloglines does not require password to get that information. You can download the Python source code here:

Or syntax highlighted source:

#!/usr/bin/env python

import re
import urllib


def check(email):
    data = urllib.urlopen(BLOGLINES_URL % urllib.quote(email))
    data = re.match(r'^|([-d]+)|(.*?)|',
    if data is not None:
        count = int(
        if count > 1:
            print '%s: %d new items.' % (email, count)
        elif count == 1:
            print '%s: 1 new item.' % email
        elif count == 0:
            print '%s: no new item.' % email
            print '%s: invalid email address.'

if __name__ == '__main__':
    import os
    import sys
    if len(sys.argv) == 1:
        print 'Usage: %s [email address] [email addresses] ...' % 
        for email in sys.argv[1:]:

Updated 9 Oct 2004: URL has been changed slightly to match the one given by Bloglines notifier API.


  • Bloglines2HTML - a Python script that downloads Bloglines feeds and convert them into static HTML.