1
2
3
4
5
6
7
8
9
10
11
12
13
|
# -*- 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)
def mark_read():
newsblur.mark_feed_as_read(request.vars["feed"])
redirect(URL("default", "index"))
|
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
>
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# -*- coding: utf-8 -*-
from pprint import pprint
import time
def view():
print ""
s = time.time()
feed = newsblur.feed(request.args[0])
stories = feed["stories"]
print time.time() - s
print feed.keys()
if not feed.has_key("feed_title"):
s = time.time()
feeds = newsblur.feeds(flat=True)["feeds"]
print time.time() - s
s = time.time()
feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0]
print time.time() - s
response.title = feed["feed_title"]
return dict(stories=stories, feed=feed)
def mark_read():
if len(request.args) > 0:
newsblur.mark_feed_as_read(request.args[0])
redirect(URL("default", "index"))
|