Artifact f7fe7a35c9e2af129788110e6c17eac86d68704c:
- File applications/mobileblur/controllers/default.py — part of check-in [cbc0649388] at 2011-11-20 03:03:33 on branch develop — Moved newsblur library from urllib to Requests. Moved username storage to the DB. Store cookie in the DB. Centralize a login function that checks the DB for a user's cookie on each page load and logs the user in if there's no cookie. (user: spiffy, size: 364) [annotate] [blame] [check-ins using]
from pprint import pprint def index(): raw_feeds = newsblur.feeds(flat=True)["feeds"] feeds = {} for feed in raw_feeds.itervalues(): for i in range(threshold, 2): if feed[thresholds[i]] > 0: feeds[feed["feed_title"]] = feed break pprint(feeds) return dict(feeds=feeds, threshold=threshold)