Artifact d9e34b59181e63bfc1fe491ca1bc0d027d5a5973:
- File applications/mobileblur/models/0_helpers.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: 355) [annotate] [blame] [check-ins using]
newsblur = local_import("newsblur") threshold = 0 thresholds = ["nt", "ps", "ng"] # indices -1, 0, 1 for negative, neutral, and positive intelligence filters def login(username="spiffytech"): user = db(db.users.username==username).select().first() if user["cookie"] is None: results = newsblur.login(user["username"], user["password"])