This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Parsing rss feed - Problem with listing all headlines in rss

Help for those learning Tcl or writing their own scripts.
Post Reply
J
Jarppa
Voice
Posts: 1
Joined: Thu Jan 31, 2008 2:41 pm

Parsing rss feed - Problem with listing all headlines in rss

Post by Jarppa »

Got it work now!

Code: Select all

bind pub - haloo lollero

proc lollero {nick host handle chan text} {
package require tdom
package require http
set url "http://www.ampparit.com/xml.php?cat=13"
set page [::http::data [::http::geturl $url]]
set doc [dom parse $page]
set root [$doc documentElement]
set node [$root selectNodes {//item/title}]
set node2 [$root selectNodes {//channel/title}]
set text [[[lindex $node 0] childNodes] nodeValue]
set text2 [[[lindex $node2 0] childNodes] nodeValue]
putserv "privmsg #kustinihkukanava :[string trim $text2] | [string trim $text]"
}
Okay, i've got it now to show first item of rss, little bit modifying script at tcl faq area.

Problem is, that i want to list all items in rss. I've tried anything that noob like me could know. :-P However, in some cases i get this "domNode0x844713c" etc. etc. thing.

Help would be nice. :-)
Post Reply