ref: bb4d0980dad80279523bb17162ea0e7eace4325a radiogopher/feeds.py -rw-r--r-- 576 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import config
import time

subscribed_feeds = config.Feeds('feeds')

def add(feed):

    if feed not in subscribed_feeds['podcasts']:
        subscribed_feeds['podcasts'][feed] = {'last_checked': None}
        subscribed_feeds.save()
        return True

def remove(feed):
    del subscribed_feeds['podcasts'][feed]
    subscribed_feeds.save()

def last_seen(feed, dt=None):
    if dt:
        subscribed_feeds['podcasts'][feed]['last_checked'] = dt
        subscribed_feeds.save()
    else:
        return time.struct_time(subscribed_feeds['podcasts'][feed]['last_checked'])