Artifact 61898c0aadf6a7c757b8278b5337e6f9afb7c254:
- File applications/mobileblur/controllers/feeds.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: 299) [annotate] [blame] [check-ins using]
# -*- coding: utf-8 -*- from pprint import pprint def view(): stories = newsblur.feed(request.args[0])["stories"] feeds = newsblur.feeds(flat=True)["feeds"] feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0] return dict(stories=stories, feed=feed)