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 

RSS news by demond
Goto page Previous  1, 2, 3, 4, 5, 6 ... 10, 11, 12  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
zigus
Voice


Joined: 11 Apr 2006
Posts: 5

PostPosted: Tue Apr 11, 2006 3:23 pm    Post subject: a lil problem :/ Reply with quote

Code:
[21:21] can't create procedure "::rss-synd::init": unknown namespace
    while executing
"proc ::rss-synd::init {args} {
        variable rss
        variable default

        package require http
        set packages(base64) [catch {package require base64}]
        set pack..."
    (file "scripts/rss-synd.tcl" line 150)
    invoked from within
"source scripts/rss-synd.tcl"
    (file "ktd.conf" line 1330)
[21:21] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)

i hav just configured my eggdrop, and i dont know what 2 do now.. can any1 help me please? sorry if im askin such noob questions... Embarassed
Back to top
View user's profile Send private message
demond
Revered One


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

PostPosted: Wed Apr 12, 2006 2:46 am    Post subject: Reply with quote

you are on the wrong thread dude

this one is about a RSS script that actually works
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
zigus
Voice


Joined: 11 Apr 2006
Posts: 5

PostPosted: Wed Apr 12, 2006 12:25 pm    Post subject: :-[ Reply with quote

sorry then, i thought that ppl can help me here, with any rss script,... i had other rss script, also mentioned in this thread.. but i wanted my bot to write also the link, but i dont know how to do it, because the script u made,doesnt support it, i think...
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 Apr 13, 2006 2:06 am    Post subject: Reply with quote

it is trivial to modify my script to do what you need, even if you don't know Tcl
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
zigus
Voice


Joined: 11 Apr 2006
Posts: 5

PostPosted: Thu Apr 13, 2006 7:56 am    Post subject: hehe : trivial Reply with quote

hehe, u said its trivial.. but i dont even know what to write in which line.. so , would you be so kind,and write me the lines i should add into your script,if i want my bot to write also the links to the news he reports?
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 Apr 14, 2006 1:20 am    Post subject: Reply with quote

no, sorry, I don't customize my scripts

what you need requires a 5-minute effort from your side, to browse through the script and add $link variable to announcement output
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
zigus
Voice


Joined: 11 Apr 2006
Posts: 5

PostPosted: Fri Apr 14, 2006 8:49 am    Post subject: .. Reply with quote

ok thanx..dunno whether i would make it by myself Smile)
i have another problem with readin my rss.. i have 2 different blogs,each with own rss feed, 1.st is : http://blog.ktd.sk/?feed=rss2 and the 2.nd is http://xxx.ktd.sk/?feed=rss2 .. well, when i put these links into ur script, the 2nd one works, but the 1st 1 doesnt wanna work, and i dont know the problem :/ when i type !rss * ,it shows me 10 titles [from xxx.ktd.sk] , but when i set it on blog.ktd.sk it tells me just : "(bot) no news for this channel", dont u know whats wrong?
Back to top
View user's profile Send private message
zigus
Voice


Joined: 11 Apr 2006
Posts: 5

PostPosted: Sat Apr 15, 2006 2:49 am    Post subject: ... Reply with quote

okay ,fortunately it works now Smile
Back to top
View user's profile Send private message
duckdown
Voice


Joined: 19 Apr 2006
Posts: 15
Location: gta

PostPosted: Wed Apr 19, 2006 2:53 pm    Post subject: Reply with quote

Hi, all.

I'm a full-time (NOVICE) Linux user here at home on my laptop, and I'm also just setting up my first botnet ever.

I have been looking since the beginning for a GOOD RSS announcer for my channels, mainly because the bots will be in a "Canadian Deals" channel, which we have a working RSS feed for.

I have all appropriate modules installed, and get NO error messages when I load up the rssnews.tcl , and thought that I had properly configured the thing; but it is not announcing anything at all publically in the channel. The Eggdrops are version 1.6.17.

Here is EXACTLY the rssnews.tcl I am using:

Code:

#######################################################################
#                                                                     #
# rssnews.tcl - RSS news announcer for eggdrop by demond@demond.net   #
#                                                                     #
#               this will announce the updated news from RSS feed(s), #
#               periodically polling the feed(s); supports multiple   #
#               channels, one feed per channel; you only need to set  #
#               the feeds array, see below                            #
#                                                                     #
#        Usage: !rss <news#|*> (read news# or * for headlines list)   #
#                                                                     #
#######################################################################

package require Tcl 8.3
package require eggdrop 1.6
package require http 2.0

namespace eval rssnews {

# set your feed(s) sources here: channel, poll frequency in mins, feed URL
#
set feeds(#splintercell) {5 http://www.******.nl/rss/rss_all.xml}
set feeds(#sPlintercell) {5 http://www.redflagdeals.com/deals/main.php/weblog/rss_atom}
#set feeds(#chan1) {17 http://www.osnews.com/files/recent.rdf}
#set feeds(#chan2) {11 http://news.google.com/news?ned=us&topic=h&output=rss}
#
# if you have to use password-protected feed, set it up like this:
# (requires base64 package from TclLib)
#
#set feeds(#chan3) {13 http://some.site.com/feed username password}

# maximum number of announced new headlines
#
variable maxnew 15

# feed fetch timeout in seconds
#
variable timeout 50

# public trigger flood settings
#
variable pubflud 8:15

# support SSL feeds (requires TLS package)
#
variable usessl 0

# if usessl is 1, request/require valid certificate from server
#
variable reqcert yes:no

#######################################################################
# nothing to edit below

variable version "rssnews-1.6"

if {[info exists feeds]} {
foreach {foo bar} [array get feeds] {
   if {[llength $bar] > 2} {package require base64; break}
}}

if {$usessl} {
   package require tls 1.5
   scan $reqcert {%[^:]:%s} r1 r2
   if {$r1 == "yes"} {set r1 1} {set r1 0}
   if {$r2 == "yes"} {set r2 1} {set r2 0}
   set ssl [list ::tls::socket -request $r1 -require $r2]
   ::http::register https 443 $ssl
}

bind pub  - !rss [namespace current]::news
bind time - *    [namespace current]::timer

putlog "$version by demond loaded"

proc timer {min hour day month year} {
   variable feeds
   if {[info exists feeds]} {
   if {$min} {set min [string trimleft $min 0]}
   foreach {chan feed} [array get feeds] {
      if {$min && $min % [lindex $feed 0] == 0} {
         if {[llength $feed] > 2} {
            foreach {t url user pass} $feed {break}
            fetch $url $chan $user $pass
         } {
            foreach {t url} $feed {break}
            fetch $url $chan
         }
      }
   }}
}

proc fetch {url chan args} {
   variable timeout
   variable version; variable token
   set to [expr {$timeout * 1000}]
   set cmd [namespace current]::callback
   if {[llength $args] > 0} {
      foreach {user pass} $args {break}
      set hdr [list Authorization "Basic [::base64::encode $user:$pass]"]
   } {   set hdr {}}
   ::http::config -useragent "$version by demond"
   if {[catch {set t [::http::geturl $url -command $cmd -timeout $to -headers $hdr]} err]} {
      putlog "$version: ERROR($chan): $err"
   } {
      set token($t) $chan
   }
}

proc callback {t} {
   variable version; variable token
   set chan $token($t)
   switch -exact [::http::status $t] {
   "timeout" {
      putlog "$version: ERROR($chan): timeout"
   }
   "error" {
      putlog "$version: ERROR($chan): [::http::error $t]"
   }
   "ok" {
      if {[::http::ncode $t] != 200} {
         putlog "$version: ERROR($chan): [::http::code $t]"
      } {
         process [::http::data $t] $chan
      }
   }
   default {
      putlog "$version: ERROR($chan): got EOF from socket"
   }}
   ::http::cleanup $t
}

proc process {data chan} {
   variable news; variable hash
   variable maxnew; variable source
   set idx 1; set count 0
   set news($chan) {}; set source($chan) ""
   if {[regexp {(?i)<title>(.*?)</title>} $data -> foo]} {
      append source($chan) $foo
   }
   if {[regexp {(?i)<description>(.*?)</description>} $data -> foo]} {
      append source($chan) " | $foo"
   }
   regsub -all {(?i)<items.*?>.*?</items>} $data {} data
   foreach {foo item} [regexp -all -inline {(?i)<item.*?>(.*?)</item>} $data] {
      regexp {(?i)<title.*?>(.*?)</title>}  $item -> title
      regexp {(?i)<link.*?>(.*?)</link}     $item -> link
      regexp {(?i)<desc.*?>(.*?)</desc.*?>} $item -> descr
      if {![info exists title]} {set title "(none)"}
      if {![info exists link]}  {set link  "(none)"}
      if {![info exists descr]} {set descr "(none)"}
      strip title link descr
      if {[info exists hash($chan)]} {
      if {[lsearch -exact $hash($chan) [md5 $title]] == -1 && [botonchan $chan]} {
         if {$count < $maxnew} {
            puthelp "privmsg $chan :($idx) $title"
            incr count
         } {
            lappend indices $idx
         }
      }}
      lappend news($chan) [list $title $link $descr]
      lappend hashes [md5 $title]
      incr idx
   }
   if {[info exists indices] && [botonchan $chan]} {
      set count [llength $indices]
      set indices "(indices: [join $indices {, }])"
      puthelp "privmsg $chan :...and $count more $indices"
   }
   set hash($chan) $hashes
}

proc strip {args} {
   variable html
   foreach a $args {
      upvar $a x
      set amp {&amp; &}
      set x [string map $amp $x]
      set x [string map $html $x]
      while {[regexp -indices {(&#[0-9]{1,3};)} $x -> idxs]} {
         set b [lindex $idxs 0]; set e [lindex $idxs 1]
         set num [string range $x [expr {$b+2}] [expr {$e-1}]]
         if {$num < 256} {
            set x [string replace $x $b $e [format %c $num]]
         }
      }
      regexp {(?i)<!\[CDATA\[(.*?)\]\]>}   $x ->    x
      regsub -all {(?i)</t[dr]><t[dr].*?>} $x { | } x
      regsub -all {(?i)(<p>|<br>|\n)}      $x { }   x
      regsub -all {<[^<]+?>}               $x {}    x
   }
}

proc news {nick uhost hand chan text} {
   variable source
   variable news; variable feeds
   variable pcount; variable pubflud
   if {[info exists pcount]} {
      set n [lindex $pcount 1]; incr n
      set ts [lindex $pcount 0]
      set pcount [list $ts $n]
      scan $pubflud {%[^:]:%s} maxr maxt
      if {$n >= $maxr} {
         if {[unixtime] - $ts <= $maxt} {return}
         set n 1; set ts [unixtime]
      }
   } {
      set n 1; set ts [unixtime]
   }
   set pcount [list $ts $n]
   set num [lindex [split $text] 0]
   if {$num == ""} {
      puthelp "notice $nick :Usage: $::lastbind <news#|*>"
      return
   }
   if {$num != "*" && ![string is integer $num]} {
      puthelp "notice $nick :argument must be number or *"
      return
   }
   if {![info exists news($chan)]} {
      puthelp "notice $nick :no news for this channel"
      return
   }
   if {$num == "*"} {
      set idx 1
      if {$source($chan) != ""} {
         set title $source($chan)
      } {
         set title [lindex $feeds($chan) 1]
      }
      puthelp "notice $nick :News source: \002$title\002"
      foreach item $news($chan) {
         puthelp "notice $nick :($idx) [lindex $item 0]"
         incr idx
      }
      return 1
   } {
   if {$num < 1 || $num > [llength $news($chan)]} {
      puthelp "notice $nick :no such news index, try $::lastbind *"
   } {
      set idx [expr {$num-1}]
      puthelp "notice $nick :......title($num): [lindex [lindex $news($chan) $idx] 0]"
      puthelp "notice $nick :description($num): [lindex [lindex $news($chan) $idx] 2]"
      puthelp "notice $nick :.......link($num): [lindex [lindex $news($chan) $idx] 1]"
      return 1
   }}
}

variable html {
   &quot;     \x22  &apos;     \x27  &amp;      \x26  &lt;       \x3C
   &gt;       \x3E  &nbsp;     \x20  &iexcl;    \xA1  &curren;   \xA4
   &cent;     \xA2  &pound;    \xA3  &yen;      \xA5  &brvbar;   \xA6
   &sect;     \xA7  &uml;      \xA8  &copy;     \xA9  &ordf;     \xAA
   &laquo;    \xAB  &not;      \xAC  &shy;      \xAD  &reg;      \xAE
   &macr;     \xAF  &deg;      \xB0  &plusmn;   \xB1  &sup2;     \xB2
   &sup3;     \xB3  &acute;    \xB4  &micro;    \xB5  &para;     \xB6
   &middot;   \xB7  &cedil;    \xB8  &sup1;     \xB9  &ordm;     \xBA
   &raquo;    \xBB  &frac14;   \xBC  &frac12;   \xBD  &frac34;   \xBE
   &iquest;   \xBF  &times;    \xD7  &divide;   \xF7  &Agrave;   \xC0
   &Aacute;   \xC1  &Acirc;    \xC2  &Atilde;   \xC3  &Auml;     \xC4
   &Aring;    \xC5  &AElig;    \xC6  &Ccedil;   \xC7  &Egrave;   \xC8
   &Eacute;   \xC9  &Ecirc;    \xCA  &Euml;     \xCB  &Igrave;   \xCC
   &Iacute;   \xCD  &Icirc;    \xCE  &Iuml;     \xCF  &ETH;      \xD0
   &Ntilde;   \xD1  &Ograve;   \xD2  &Oacute;   \xD3  &Ocirc;    \xD4
   &Otilde;   \xD5  &Ouml;     \xD6  &Oslash;   \xD8  &Ugrave;   \xD9
   &Uacute;   \xDA  &Ucirc;    \xDB  &Uuml;     \xDC  &Yacute;   \xDD
   &THORN;    \xDE  &szlig;    \xDF  &agrave;   \xE0  &aacute;   \xE1
   &acirc;    \xE2  &atilde;   \xE3  &auml;     \xE4  &aring;    \xE5
   &aelig;    \xE6  &ccedil;   \xE7  &egrave;   \xE8  &eacute;   \xE9
   &ecirc;    \xEA  &euml;     \xEB  &igrave;   \xEC  &iacute;   \xED
   &icirc;    \xEE  &iuml;     \xEF  &eth;      \xF0  &ntilde;   \xF1
   &ograve;   \xF2  &oacute;   \xF3  &ocirc;    \xF4  &otilde;   \xF5
   &ouml;     \xF6  &oslash;   \xF8  &ugrave;   \xF9  &uacute;   \xFA
   &ucirc;    \xFB  &uuml;     \xFC  &yacute;   \xFD  &thorn;    \xFE
   &yuml;     \xFF
}

}


Now, I have had the tcl loaded for over 3 hours, and haven't seen a single thing appear publically in the channel.

If I say "!rss *" in the actual channel, then it /notice's me 10 results (Without HTTP links to the articles also I should add, something I would like to have if possible) but doesn't say a peep in the channel.

I know the feeds are being updated because I get all kinds of new articles in my Akgregator (KDE RSS Reader).

When the bot loads, I see:

Quote:

<duckdown> .rehash
<chlorate> [14:05] #duckdown# rehash
<chlorate> Rehashing.
<chlorate> [14:05] Writing user file...
<chlorate> [14:05] Writing channel file...
<chlorate> [14:05] Rehashing ...
<chlorate> [14:05] Listening at telnet port ***** (all).
<chlorate> [14:05] BotNet Commands v1.1 MrHat_ (mrhat@thepentagon.com EFNet: #SouthPark, #Freedows) loaded
<chlorate> [14:05] Userinfo TCL v1.07 loaded (URL BF GF IRL EMAIL DOB PHONE ICQ).
<chlorate> [14:05] use '.help userinfo' for commands.
<chlorate> [14:05] loaded netops.tcl v1.3 by cucgod
<chlorate> [14:05] rssnews-1.6 by demond loaded
<chlorate> [14:05] Userfile loaded, unpacking...


So I don't spot anything wrong as far as that goes, and as I said, the !rss command is able to display 10 basic results...

Maybe I'm not looking in the right place; or did I do something wrong inside the .tcl ?

I'm on EFnet under the nick 'duckdown' and I'd be more than happy to let you fool around with the bots; they aren't doing anything yet but I'd really like to get these going..

Cheers all, thanks for your time! Smile
Back to top
View user's profile Send private message MSN Messenger
duckdown
Voice


Joined: 19 Apr 2006
Posts: 15
Location: gta

PostPosted: Wed Apr 19, 2006 5:58 pm    Post subject: Reply with quote

Well I've just tried on another stock 1.6.16 installation (in case 1.6.17 was the problem) and nope, same thing still. Every other script I try works, but this one simply will not announce ANYTHING in the channel.

Log files are totally clean; it just shows that the script is loaded.

I can paste any info you may require... Help Sad
Back to top
View user's profile Send private message MSN Messenger
demond
Revered One


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

PostPosted: Thu Apr 20, 2006 12:57 am    Post subject: Reply with quote

Quote:

http://www.redflagdeals.com/deals/main.php/weblog/rss_atom

this feed is not RSS, it's Atom feed - that format is not supported by the script

what's your other feed? the masked one
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
duckdown
Voice


Joined: 19 Apr 2006
Posts: 15
Location: gta

PostPosted: Thu Apr 20, 2006 1:39 pm    Post subject: Reply with quote

I've tried the rss 2.0 one also to no avail Sad
The masked word was 'nforce'
Back to top
View user's profile Send private message MSN Messenger
demond
Revered One


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

PostPosted: Fri Apr 21, 2006 1:20 am    Post subject: Reply with quote

duckdown wrote:
I've tried the rss 2.0 one also to no avail Sad
The masked word was 'nforce'


it works fine for me

check again your log, there MUST be something hinting what the error is

leave only one feed per channel; if you need multiple feeds on the same channel, run more bots
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
duckdown
Voice


Joined: 19 Apr 2006
Posts: 15
Location: gta

PostPosted: Fri Apr 21, 2006 1:58 pm    Post subject: Reply with quote

demond wrote:
duckdown wrote:
I've tried the rss 2.0 one also to no avail Sad
The masked word was 'nforce'


it works fine for me

check again your log, there MUST be something hinting what the error is

leave only one feed per channel; if you need multiple feeds on the same channel, run more bots


I've checked so many times now, trying to look for ANYTHING that would indicate an error, but theres nothing to be seen..

Maybe I'll try again with just a single feed for the channel, and pick a REAL busy rss feed like google news..
Back to top
View user's profile Send private message MSN Messenger
skipyy
Voice


Joined: 22 Apr 2006
Posts: 3

PostPosted: Sun Apr 23, 2006 1:46 am    Post subject: Reply with quote

is there an option when it annouce new post it will give the url? so !rss cmd wont be needed so much?

now when new post it shows on chan only title of post..when i do !rss 1 i see url also so is it possible?

and another question
does this rss http://www.torec.net/rss.asp supported by the script?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6 ... 10, 11, 12  Next
Page 5 of 12

 
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