#!/usr/bin/env python
import feedparser, os, time

SCROLLER="./scroller"
#RSS='http://www.abc.net.au/news/syndicate/topstoriesrss.xml'
RSS='http://rss.cricinfo.com/feed/cricinfo/Live_Scores'

d = feedparser.parse(RSS)

count = 0

while True:
    for item in d['entries']:
        item = "%s" % (item['title'])
	print ('sending %s' % (item[0:72]))
        os.system("%s '%s'" % (SCROLLER, item[0:72]))
        time.sleep(15)
        count = count + 1
        if count % 40 == 0:
            print "refreshing feed"
            d = feedparser.parse(RSS)
                       

