egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

possible to make eggdrop auto-rehash every x minutes?
Goto page Previous  1, 2, 3, 4
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Tue Aug 09, 2005 11:50 am    Post subject: Reply with quote

Code:

Currently: syntaxerror {syntax error: PUBLIC identifier not followed by system literal around line 1}
Currently:     while executing
Currently: "rss::parse [http::data $token]"
Currently:     (procedure "retrieve" line 3)
Currently:     invoked from within
Currently: "retrieve $feed"
Currently:     ("foreach" body line 6)
Currently:     invoked from within
Currently: "foreach {chan feed} [array get feeds] {
Currently:          set chan [string tolower $chan]
Currently:          if {[lsearch -exact [string tolower [channels]] $chan] == -1..."
Currently:     invoked from within
Currently: "if [info exists feeds] {
Currently:       foreach {chan feed} [array get feeds] {
Currently:          set chan [string tolower $chan]
Currently:          if {[lsearch -exact [string t..."
Currently:     (procedure "::news::timer" line 4)
Currently:     invoked from within
Currently: "::news::timer $_time1 $_time2 $_time3 $_time4 $_time5"
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 09, 2005 11:56 am    Post subject: Reply with quote

this is an error reported by TclXML, something's wrong with document's XML schema; try with another RSS source, for example http://rss.news.yahoo.com/rss/topstories

BTW which RSS package did you install, BDK's or the japanese?
Back to top
View user's profile Send private message Visit poster's website
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Tue Aug 09, 2005 12:10 pm    Post subject: Reply with quote

I use BDK's package, in fact only rss.tcl + pkg_mkIndex etc etc as you described it on the first page.

Well, I'm trying your link and I get

Code:
[18:08:48] <Bot-de-test>
Currently: invalid command name ""
Currently:     while executing
Currently: "$channel items"
Currently:     (procedure "retrieve" line 5)
Currently:     invoked from within
Currently: "retrieve $feed"
Currently:     ("foreach" body line 6)
Currently:     invoked from within
Currently: "foreach {chan feed} [array get feeds] {
Currently:          set chan [string tolower $chan]
Currently:          if {[lsearch -exact [string tolower [channels]] $chan] == -1..."
Currently:     invoked from within
Currently: "if [info exists feeds] {
Currently:       foreach {chan feed} [array get feeds] {
Currently:          set chan [string tolower $chan]
Currently:          if {[lsearch -exact [string t..."
Currently:     (procedure "::news::timer" line 4)
Currently:     invoked from within
Currently: "::news::timer $_time1 $_time2 $_time3 $_time4 $_time5"
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 09, 2005 1:35 pm    Post subject: Reply with quote

all I can recommend to you at this time is to try other RSS feeds

there might be some incompatibility with BDK's rss.tcl introduced in those packages in their latest versions; mine are from like one year ago
Back to top
View user's profile Send private message Visit poster's website
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Tue Aug 09, 2005 2:51 pm    Post subject: Reply with quote

Could you link your rss.tcl? Smile
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 09, 2005 3:25 pm    Post subject: Reply with quote

Code:

 package require Tcl 8.4
 package require struct
 package require xml
 package require snit

 package provide rss 1.0

 namespace eval ::rss {
    variable parser
    variable parserStack
    variable channelObject
    variable itemObject

    variable currentCmds
    array set currentCmds \
        [list \
             elementStart [list [namespace current]::XML.StartRSS] \
             elementEnd [list [namespace current]::XML.EndRSS] \
             characterData {} \
            ]
 }

 proc ::rss::Parser.NewState {elementStart elementEnd characterData} {
    variable parser
    variable parserStack
    variable currentCmds
    variable channel

    $parserStack push \
        [list \
             $currentCmds(elementStart) \
             $currentCmds(elementEnd) \
             $currentCmds(characterData) \
             ]

    set currentCmds(elementStart) $elementStart
    set currentCmds(elementEnd) $elementEnd
    set currentCmds(characterData) $characterData

    return
 }

proc ::rss::Parser.PreviousState {} {
    variable parser
    variable parserStack
    variable currentCmds

    foreach {currentCmds(elementStart) currentCmds(elementEnd) currentCmds(characterData)} [$parserStack pop] {break}

    return
 }

 proc ::rss::Wrapper.ElementStart {name attlist args} {
    variable currentCmds

    if {$currentCmds(elementStart)!={}} {
        set code [catch {uplevel \#0 $currentCmds(elementStart) [list $name $attlist] $args} result]
        return -code $code -errorinfo $::errorInfo -errorcode $::errorCode $result
    }
 }

 proc ::rss::Wrapper.ElementEnd {name args} {
    variable currentCmds

    if {$currentCmds(elementEnd)!={}} {
        set code [catch {uplevel \#0 $currentCmds(elementEnd) [list $name] $args} result]
        return -code $code -errorinfo $::errorInfo -errorcode $::errorCode $result
    }
 }

 proc ::rss::Wrapper.CharacterData {data} {
    variable currentCmds

    if {$currentCmds(characterData)!={}} {
        set code [catch {uplevel \#0 $currentCmds(characterData) [list $data]} result]
        return -code $code -errorinfo $::errorInfo -errorcode $::errorCode $result
    }
 }

 proc ::rss::parse {data} {
    variable parser
    variable parserStack
    variable channel

    set parser [::xml::parser ]
    set parserStack [::struct::stack]
    set channel [Channel %AUTO%]

    $parser configure \
        -elementstartcommand [namespace current]::Wrapper.ElementStart \
        -elementendcommand [namespace current]::Wrapper.ElementEnd \
        -characterdatacommand [namespace current]::Wrapper.CharacterData

    $parser parse $data

    $parser free
    $parserStack destroy

    return $channel
 }

 proc ::rss::XML.StartRSS {name attlist args} {
    variable channel

    switch -- $name {
        channel {
            Parser.NewState \
                [list [namespace current]::XML.Channel $channel] \
                [list [namespace current]::XML.ElementEnd] \
                {}
        }
        item {
            set obj [Item %AUTO%]
            $channel AddItem $obj

            Parser.NewState \
                [list [namespace current]::XML.Item $obj] \
                [list [namespace current]::XML.ElementEnd] \
                {}
        }
    }

    return
 }

 proc ::rss::XML.EndRSS {name args} {
    return
 }

 proc ::rss::XML.Channel {obj name attlist args} {
    switch -- $name {
        title {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable title]]
        }
        link {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable link]]
        }
        description {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable description]]
        }
        item {
            set item [Item %AUTO%]
            $obj AddItem $item

            Parser.NewState \
                [list [namespace current]::XML.Item $item] \
                [list [namespace current]::XML.ElementEnd] \
                {}
        }
        default {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                {}
        }
    }

    return
 }

 proc ::rss::XML.Item {obj name attlist args} {
    switch -- $name {
        title {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable title]]
        }
        link {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable link]]
        }
        description {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                [list [namespace current]::XML.CharacterData [$obj GetVariable description]]
        }
        default {
            Parser.NewState \
                [list [namespace current]::XML.ElementStart] \
                [list [namespace current]::XML.ElementEnd] \
                {}
        }
    }

    return
 }

 proc ::rss::XML.ElementStart {name attlist args} {
    Parser.NewState \
        [list [namespace current]::XML.ElementStart] \
        [list [namespace current]::XML.ElementEnd] \
        {}

    return
 }

 proc ::rss::XML.ElementEnd {name args} {
    Parser.PreviousState

    return
 }

 proc ::rss::XML.CharacterData {var data} {
    upvar \#0 $var myVar

    append myVar $data

    return
 }

 ::snit::type ::rss::Channel {
    variable title {}
    variable link {}
    variable description {}
    variable items {}

    destructor {
        foreach item $items {
            $item destroy
        }

        return
    }

    method title {} {
        return $title
    }

    method link {} {
        return $link
    }

    method description {} {
        return $description
    }

    method items {} {
        return $items
    }

    method GetVariable {var} {
        return [varname $var]
    }

    method AddItem {item} {
        lappend items $item
    }
 }

 ::snit::type ::rss::Item {
    variable title {}
    variable link {}
    variable pubDate {}
    variable description {}

    method title {} {
        return $title
    }

    method link {} {
        return $link
    }

    method pubDate {} {
        return $pubDate
    }

    method description {} {
        return $description
    }

    method GetVariable {var} {
        return [varname $var]
    }
 }
Back to top
View user's profile Send private message Visit poster's website
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Tue Aug 09, 2005 4:26 pm    Post subject: Reply with quote

Ahhhhh yes, works better now, thx m8 Smile
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 09, 2005 9:04 pm    Post subject: Reply with quote

it works?? yay!

you are the first person (besides me hehe) to get that to work Smile congrats
Back to top
View user's profile Send private message Visit poster's website
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Wed Aug 10, 2005 1:01 pm    Post subject: Reply with quote

Yes, I'll modify your script for notices => privmsg $chan and add some colors ala perpleXa's RSSNews.
Back to top
View user's profile Send private message
Korigon
Voice


Joined: 02 Aug 2005
Posts: 8

PostPosted: Wed Aug 10, 2005 3:30 pm    Post subject: Reply with quote

what is the correct syntax if I want add some chan and/or news ?

set feeds(#chan1) {10 http://www.b.d.e/rss/1.xml}
set feeds(#chan2) {10 http://www.a.b.c/rss/2.xml}

or
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Aug 11, 2005 12:15 am    Post subject: Reply with quote

that is correct
Back to top
View user's profile Send private message Visit poster's website
JoshuaUK
Voice


Joined: 07 Aug 2005
Posts: 24

PostPosted: Fri Aug 12, 2005 8:07 pm    Post subject: Reply with quote

Hi, When I install this script you are talking about, I bought a shell now running eggdrop 1.6.17. Now could you please just tell me what if possible I do with the tcllib or xml which one do I get? err also, I moved the rss.tcl to home/user/scripts/ and will it still work it loads but fails because it cannot find the required things:

Code:

 package require Tcl 8.4\par
 package require struct 2.0\par
 package require xml 2.6\par
 package require snit 0.9\par
\par
 package provide rss 1.0\par
\par
 namespace eval ::rss \{\par
    variable parser\par
    variable parserStack\par
    variable channelObject\par
\par
    variable currentCmds\par
    array set currentCmds \\\par
        [list \\\par
             elementStart [list [namespace current]::XML.StartRSS] \\\par
             elementEnd [list [namespace current]::XML.EndRSS] \\\par
             characterData \{\} \\\par
            ]\par
 \}
[01:03] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
[joshuauk@server2 bot]$ TclLib


I know you mentione dreading up on it, but I don't really take things in if someone just says read about them sorry Sad
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 12, 2005 10:08 pm    Post subject: Reply with quote

that you don't want to give up on my script flatters me, however neither this thread nor this forum are meant to teach you how to install Tcl packages - you either learn that yourself by reading the docs that come with packages sources (if you read but didn't understand those, you need to learn how to use Linux/UNIX (shell) first, also by reading - I'd recommend you buy a book on that subject) and then come here if necessary for help on a particular installation issue that you had, or you hire me to teach you how to do stuff without actually bothering to read too much - but I'll have to charge you my usual consulting fee; what I'm trying to explain to you (again) is that these forums are meant to help people who are willing to help themselves first and only ask for help if that fails

sorry if this isn't what you wanted to hear, but that's the way the things are

and folks, if you need further elaboration on my RSS news script, please make a new thread about it and post there; this thread got overused, not to mention it's not relevant to my script in the first place - at least the title has nothing to do with it

edit: I made a new thread on the subject here
Back to top
View user's profile Send private message Visit poster's website
JoshuaUK
Voice


Joined: 07 Aug 2005
Posts: 24

PostPosted: Sat Aug 13, 2005 4:38 pm    Post subject: Reply with quote

Well I tried installing the tcllib thing and it worked when I typed in make, then make install failed because it couldn't gain access to the usr lib directory Neutral So not sure if it is something I have managed to do or what lol. But I seem to have got a small part of the way... will still keep playing with it, as the reason I bought a shell was to run the RSS news feeds with this script or somehow into a chatroom someday.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber