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:
- Download: bloglines.py
Or syntax highlighted source:
#!/usr/bin/env python
import re
import urllib
BLOGLINES_URL = "http://rpc.bloglines.com/update?ver=1&user=%s"
def check(email):
data = urllib.urlopen(BLOGLINES_URL % urllib.quote(email))
data = re.match(r'^|([-d]+)|(.*?)|', data.read())
if data is not None:
count = int(data.group(1))
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
else:
print '%s: invalid email address.'
if __name__ == '__main__':
import os
import sys
if len(sys.argv) == 1:
print 'Usage: %s [email address] [email addresses] ...' %
os.path.basename(sys.argv[0])
else:
for email in sys.argv[1:]:
check(email)
Updated 9 Oct 2004: URL has been changed slightly to match the one given by Bloglines notifier API.
Related
- Bloglines2HTML – a Python script that downloads Bloglines feeds and convert them into static HTML.
hi, just wanted to let u know that i inserted the tag you mentioned in my other blogs and it worked! thanks!
:)
I was having fun ripping off the banner ads on the free services, and I am pretty sure that this kind of HOWTO must be documented everywhere. Not really sure whether it is a Christian thing to do.
Well. Back to the Bloglines notifier. Now I just need to add that to my Jabber bot so I can get instant message whenever there is a new item. Yup. A new idea for procrastination…