File: _web_example4.py

package info (click to toggle)
nodebox-web 1.9.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,900 kB
  • sloc: python: 7,582; ansic: 581; xml: 239; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Reading newsfeeds.

import web

# Get the first URL from our favorites list.
url = web.newsfeed.favorites.values()[0]

# Parse the newsfeed data into a handy object.
feed = web.newsfeed.parse(url)

# Get the title and the description of the feed.
print feed.title, "|", feed.description

for item in feed.items:
    print "-" * 40
    print "- Title       :", item.title
    print "- Link        :", item.link
    print "- Description :", web.html.plain(item.description)
    print "- Date        :", item.date
    print "- Author      :", item.author

print item.description