Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 18th, 2004, 04:35 PM
ain ain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 49 ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
rss feeder

hi,

i am supposed to make a rss feeder, where should i start?? have anybody any code examples???

thanks

ain

Reply With Quote
  #2  
Old October 18th, 2004, 05:40 PM
ilves ilves is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Norway
Posts: 41 ilves User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 22 sec
Reputation Power: 6
Not sure if you mean to create an rss feed or parse an rss feed. Anyway it's not too hard with the xml functionality in the standard library. The xml.dom.minidom package is a good start.

Alternatively, use the excellent ElementTree module.


If rss.xml is an RSS 1.0 file this code should store the urls and titles of the items in the rss file as a list of (url, title) tuples.
Code:
import xml.dom.minidom

rssfile = "rss.xml"
buffer = []
doc = xml.dom.minidom.parse(rssfile)

items = doc.getElementsByTagName("item")
for item in items:
  link = item.getElementsByTagName("link")[0]
  url = str(link.firstChild.data.strip())
  title = item.getElementsByTagName("title")[0]
  title = str(title.firstChild.data.strip())
  buffer.append((url, title))
__________________
Good web hosting info - articles about web hosting
hb's web dev blog

Reply With Quote
  #3  
Old October 18th, 2004, 08:06 PM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
Perhaps a google for python rss py

grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #4  
Old October 19th, 2004, 06:52 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Maybe worth mentioning: Pythons current RSS offerings don't work on Windows since they seem to be using *nix only features - Specifically Mark Nottinghams RSS.py

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #5  
Old October 21st, 2004, 10:38 AM
ilves ilves is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Norway
Posts: 41 ilves User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 22 sec
Reputation Power: 6
I think that Universal Feed Parser is worth mentioning too.

Reply With Quote
  #6  
Old October 21st, 2004, 02:50 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Wow, why didn't this come up in my search on google . Thanks for the link!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > rss feeder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT