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.

google tcl script problems

Old posts that have not been replied to for several years.
Locked
P
PloP

google tcl script problems

Post by PloP »

anyone else but me having problems with google tcl scripts ?

stopped working sometime today, and i get this output from supergoogle 1.3:

<pluppa> [15:15] DEBUG: Query built (http://www.google.com/search?q=eggdrop&num=5)
<pluppa> [15:15] DEBUG: Contacting website...
<pluppa> [15:15] DEBUG: Got state (HTTP/1.0 200 OK)
<pluppa> [15:15] DEBUG: Got data (13492 bytes)
<pluppa> [15:15] DEBUG: Could not find items to parse.
<pluppa> [15:15] [SG] (#hejsa) PloP requested eggdrop but couldn't find any results.

i used supergoogle1.2 earlier today but it's the same crap :/
i also tried the google script from ruptbot.com, but it doesnt work either.

i'm on tcl8.3
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Do a search for supergoogle on the forum, and you will find the solution

http://forum.egghelp.org/viewtopic.php? ... upergoogle
P
PloP

Post by PloP »

I don't think it's the same problem, and besides i changed my user agent info way before that in the http.tcl so i had no problem using the old supergoogle. http://forum.egghelp.org/viewtopic.php? ... ght=google

the thread you are refering too, is about DEBUG: Got state (HTTP/1.0 403 Forbidden)
i get a DEBUG: Could not find items to parse.
m
mike-c
Voice
Posts: 20
Joined: Thu Jul 25, 2002 3:40 pm

Post by mike-c »

Same problem here.... I've tried 2 different google scripts...

One returns every result as 'http://</script' , and the other says no results.

The former searches google.yahoo.com rather than google.com.

The latter includes debugging (supergoogle), and the output was:

DEBUG: Query built (http://www.google.com/search?q=foo&num=1)
DEBUG: Contacting website...
DEBUG: Got state (HTTP/1.0 200 OK)
DEBUG: Got data (10106 bytes)
DEBUG: Could not find items to parse.


Cheers,

Mike
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is down to the site design being changed.

When they change the design, the pointers that the script looks for also changes, thus making it unparsable to the script.
m
mike-c
Voice
Posts: 20
Joined: Thu Jul 25, 2002 3:40 pm

Post by mike-c »

That's what I thought... thanks for confirming....

The question is, who's gonna fix it :lol:

My knowledge of TCL is sadly lacking.

Cheers,

Mike
P
PloP

Post by PloP »

mike-c wrote:That's what I thought... thanks for confirming....

The question is, who's gonna fix it :lol:

My knowledge of TCL is sadly lacking.

Cheers,

Mike
I've mailed brother (author of supergoogle)and whined about it, and he said he would look into it when he had time for it. i'm unfortunatly to useless to do anything about it myself :/
M
MORA
Voice
Posts: 10
Joined: Mon Apr 15, 2002 8:00 pm

This one works.

Post by MORA »

This one works, not very fancy though, just shows one URL when using !google



# google.tcl v0.2.1
#
# !google keywords - displays the first related website found from google in the channel
# !image keywords - displays the first related image found on google in the channel
# !file keywords - displays the first mirror download link found on filemirrors in the channel
#
# by aNa|0Gue - analogue@glop.org - http://www.glop.org/
#
# 04/17/2002 v0.2.1 useragent fix by FAN

package require http

bind pub - !google pub:google
bind pub - !image pub:image
bind pub - !file pub:file

set agent "Mozilla"

proc pub:google { nick uhost handle channel arg } {
global agent
if {[llength $arg]==0} {
putserv "PRIVMSG $channel :hey ! tappes des mots boulet !"
} else {
set query "http://www.google.de/search?btnI=&q="
for { set index 0 } { $index<[llength $arg] } { incr index } {
set query "$query[lindex $arg $index]"
if {$index<[llength $arg]-1} then {
set query "$query+"
}
}
#putserv "PRIVMSG $channel :$query"
set token [http::config -useragent $agent]
set token [http::geturl $query]
puts stderr ""
upvar #0 $token state
set max 0
foreach {name value} $state(meta) {
if {[regexp -nocase ^location$ $name]} {
set newurl [string trim $value]
putserv "PRIVMSG $channel :$newurl"
}
}
}
}

proc pub:image { nick uhost handle channel arg } {
global agent
if {[llength $arg]==0} {
putserv "PRIVMSG $channel :hey ! tappes des mots boulet !"
} else {
set query "http://images.google.de/images?btnI=&q="
for { set index 0 } { $index<[llength $arg] } { incr index } {
set query "$query[lindex $arg $index]"
if {$index<[llength $arg]-1} then {
set query "$query+"
}
}
append query &imgsafe=off
# putserv "PRIVMSG $channel :$query"
set token [http::config -useragent $agent]
set token [http::geturl $query]
puts stderr ""
upvar #0 $token state
set max 0
foreach {name value} $state(meta) {
if {[regexp -nocase ^location$ $name]} {
set starturl "http://"
set newurl [string trim $value]
set newurl [string range $newurl [expr [string first = $newurl]+1] [expr [string first & $newurl]-1]]
append starturl $newurl
putserv "PRIVMSG $channel :$starturl"
}
}
}
}

proc pub:file { nick uhost handle channel arg } {
global agent
if {[llength $arg]==0} {
putserv "PRIVMSG $channel :hey ! tappes un nom de fichier boulet !"
} else {
set query "http://www.filemirrors.com/find.src?file="
set query "$query[lindex $arg 0]"
# putserv "PRIVMSG $channel :$query"
set token [http::config -useragent $agent]
set token [http::geturl $query]
set html [http::data $token]
puts stderr ""
upvar #0 $token state
set max 0
# foreach {name value} $state(meta) {
# putserv "PRIVMSG $channel :$value"
# }
# putserv "PRIVMSG $channel :$html"
set result "[lindex $html 1]"
set result [string range $result [expr [string first = $result]+2] [expr [string first > $result]-2]]
putserv "PRIVMSG $channel :$result"
}
}

putlog "Google v0.2.1 - LOADED!"
MORA @ EFNET #egghelp =)
T
TomSommer

Post by TomSommer »

no, fix supergoogle... supergoogle rocks
P
PloP

Post by PloP »

indeed, an eggdrop is useless without supergoogle =)
Locked