| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Aug 26, 2006 10:42 pm Post subject: how i updated incith-google |
|
|
I didn't realize this script was still being updated. Saw it in tcl library and for last few months I've been updating it myself. The core of it is incith-google version 1.8.
A bit outdated, yes, but some of my additions you may want to incorporate. here's a short changelog of what changes I remembered I made. I am by no means that good at coding tcl, it will be evident by some of my regexp/regsub approaches and some of the other dirty methods I used to correct minor flaws.
Hope somebody finds some of this work useful. I find it useful in the channels I run at least.
Changelog:
1.9:
- updated various regexp's and regsub's in almost all procs to fix non functioning html parsing.
- added !localuk option to display United Kingdom.
- added !youtube for searching videos on youtube.
- added !atomfilms for searching videos on atomfilms.
- added !ifilm for searching videos on ifilm.
- added !gamespot for searching games, etc on gamespot.
- added !gamefaqs, it is able to parse multiple systems and regions, still a work in progress, all bugs have been squashed.
.1:
- added !blog for searching blogsearch.google.
- added !ebay for searching ebay auctions.
- added !ebayfight for amusement, same as googlefight.
- fixed various minor annoyances.
- finally fixed !book (aka print) to work with books.google.
- added !ign for searching ign's website for movies,games,etc.
.2:
- added support for total_search option to show total results or not.
- added support for link_only option (d4z3d1 requested).
- added back complete support for desc/link modes results will now get formatted properly.
(note: doesn't affect gamefaqs list or geobytes location replies)
- added !locate <ip/hostmask> for fetching location info from geobytes.
I also messed around with incith-weather and added some to it as well, although my additions to it aren't documented at all. :/ The core used for this is version 2.2.
here's the link to the weather tcl: http://kiczek.com/ereader/UNOFFICIAL-incith-weather.tcl
Hopefully someone will find these useful and incorporate the changes into the official tcl's. Apologies ahead of time for the messy code.
edit:
back again so soon, tried my best to clean up and implement features the script had before I added to it. Everything should now be pretty much perfect (still may be unneccessary code here and there but nothing that would cause bugs), and as d4z3d1 suggested.. added two options to config section.
# set this to 0 to turn off total results appearing with searches.
variable total_results 1
# set this to 1 to remove descriptions and set only links to show
variable link_only 0
enjoy, ~speechless
Last edited by speechles on Fri Sep 22, 2006 3:03 pm; edited 3 times in total |
|
| Back to top |
|
 |
rix Halfop
Joined: 21 Sep 2005 Posts: 42 Location: Estonia
|
Posted: Wed Sep 20, 2006 3:37 pm Post subject: |
|
|
| Can user define the number of results displayed via command? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Sep 21, 2006 1:27 am Post subject: |
|
|
| Code: | # number of search results/image links to return, 'define:' is always 1 as some defs are huge
variable search_results 4
variable image_results 4
variable local_results 4
variable group_results 3
variable news_results 3
variable print_results 2
variable video_results 4
variable youtube_results 5
variable locate_results 1
variable gamespot_results 3
variable ifilm_results 5
variable atom_results 5
variable gamefaq_results 20
variable blog_results 3
variable ebay_results 3
variable ign_results 3 |
While it is indeed possible to make these adaptable via partyline, it would seem these wouldn't change often enough to justify coding it for partyline use. It's more like a set-it-and-forget-it setting, so I never cared to add the ability for partyline settings of them... sorries
edit: If by user, you meant person using the eggdrop issuing commands. That is also possible, but would require recoding every proc to pass an additional parameter.. as well as coding the input parser to watch for result switches.. it would require alot of changes i'm not prepared to make at this point, again, sorries..  |
|
| Back to top |
|
 |
Hellster Voice
Joined: 10 Aug 2006 Posts: 22
|
Posted: Fri Sep 22, 2006 11:15 am Post subject: |
|
|
Not sure if anyone else has had this , but when i load the script up on my eggdrop bot it just crashes , running eggdrop v1.6.18 |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Sep 22, 2006 11:19 am Post subject: |
|
|
| Hellster wrote: | Not sure if anyone else has had this , but when i load the script up on my eggdrop bot it just crashes , running eggdrop v1.6.18 |
Remove all custom scripts (except incith:google) and then add until you find the one causing the problem.
Logs sometimes contain more information, also the dump file (if created). _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 22, 2006 3:12 pm Post subject: |
|
|
Now i know this one works, this is my WIP tcl, but since I'm not fully sure if that old tcl I posted worked.. I figured I would share what I had up to this point. The code is rough on the !wiki and !review procs because it's far from final, but I am sure this works because I see it used everyday..
consider this unofficial, call it say 1.9.3 and get it below:
http://kiczek.com/ereader/UNOFFICIAL-incith-google-v1.93.tcl
tested on windrop, eggdrop v1.6.17 also on linux, eggdrop v1.6.18..
if you prefer madwoota's script, find it in the archive, this was just written as an attempt to learn tcl and make an already awesome script more gamer friendly.  |
|
| Back to top |
|
 |
wout0r Voice
Joined: 03 Oct 2006 Posts: 2
|
Posted: Tue Oct 03, 2006 4:35 am Post subject: |
|
|
I have loaded the tcl into mine eggdrop, I am using eggdrop v1.6.17, on Linux 2.6.17.11-grsec.
But somehow I cant get the script working
if I type !gamefaqs xbox in usa in the irc chan the bot won't do a thing ;(
any ideas what it can be?
do I need to chanset it first ? (i'm not using the google feature) _________________ it's the fruit that makes the fristi |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Oct 03, 2006 2:01 pm Post subject: |
|
|
you need to:
.chanset #yourchan +google
afterall, the gamefaqs is incorporated, if you don't want certain functions working, look in the config section for "_results" and set those to 0 to disable them. |
|
| Back to top |
|
 |
wout0r Voice
Joined: 03 Oct 2006 Posts: 2
|
Posted: Wed Oct 04, 2006 3:33 am Post subject: |
|
|
Thanks for the reply; it helped indeed. _________________ it's the fruit that makes the fristi |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Thu Oct 05, 2006 1:43 pm Post subject: |
|
|
Just thought I'd pop in to say, madwoota is slowly working on a new version of google, revamped and cleaned up, it's just taking some time, real life and all.
If anyone wants a version with !local searches working, you can grab my version which is based off madwoota last cvs: http://incith.incith.com/eggdrop/incith-google-icvs.tcl.gz
Regards~ _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
hello Voice
Joined: 06 Oct 2006 Posts: 4
|
Posted: Fri Oct 06, 2006 11:44 am Post subject: |
|
|
Hi guys
Any chance we could get on the !review game it have the platform also
like this
(nick) !review metal of honor xbox
(eggy) Sorry, no search results were found.(or if its not on that platform have it say game is not on this platform)
where u have to put what platform u want the review to come from and if u don't put a platform then it just takes the first one it see's and if no review the maybe do just the normal as I know some games do not come on
all the platforms.
Thanks for the great scripts |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Oct 06, 2006 4:50 pm Post subject: |
|
|
@incith and madwoota;
mad respect and I love the scripting style very very elegant (commented code is always nice to learn from). this unofficial stuff I wrote is by no means to replace your efforts, keep up the good work mates.
@hello;
The problem there is two fold. First off, gamespot doesn't let you search very easily. Right now to search, script just uses this: | Code: | | http://www.gamespot.com/pages/search/index.php?qs=${input} |
using the above url, doesnt allow parsing with systems, etc, as part of the query.. To do that, they would rather people use what is below: | Code: | | http://www.gamespot.com/pages/search/adv_search.php?qs=${input} |
the problem with this, is gamespot uses forms on this search page, and each system isn't simply 'GBA' for gameboy advance, 'XBOX' for xbox.. its some cryptic number.. like below:
| Quote: | <input type="checkbox" name="platform[]" value="5"> <img src="http://img.gamespot.com/gamespot/shared/head2/pc_on.gif"> PC
</td>
<td width="140">
<input type="checkbox" name="platform[]" value="1029"> <img src="http://i.i.com.com/cnet.g2/shared/gs5/themes/standard/icon_xbox360.gif" align="absbottom"> Xbox 360
</td>
<td width="140">
<input type="checkbox" name="platform[]" value="13"> <img src="http://img.gamespot.com/gamespot/shared/head2/xbox_on.gif" align="absbottom"> Xbox |
so 5 == PC, 1029 == X360, 13 = XBOX, very very cryptic ;/
A list of those numbers in order, and another list with systems in same order, would be needed. That way you just check the 2nd list for type of system person wants the game review for, and the corresponding spot in the 1st list is the cryptic number it is.. plus all the work required to make it properly submit the form and get the correct html..heh, it's a handful...
IGN also could be used, but doesn't actually have scores or game rankings like gamespot does. When I learn a bit more TCL I will tackle how to approach fixing it to use the forms submittal url instead of the query url it uses presently..
edit-------------------------------------
After investigating a bit, this wouldn't be so hard as first thought.. Gimme a week or so (I have a real life too ) and let's see where I get..
The two lists I need were in a drop down box side by side, see below: | Quote: | <select name="platform[]" style="font-face: verdana; font-size: 9px">
<option></option>
<option value="15">3DO</option>
<option value="1042">Adventurevision</option>
..snipped because of length..
<option value="23">WonderSwan Color</option>
<option value="1027">Zodiac</option> |
to be continued... hehehe |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Oct 06, 2006 11:18 pm Post subject: |
|
|
| speechles wrote: |
the problem with this, is gamespot uses forms on this search page, and each system isn't simply 'GBA' for gameboy advance, 'XBOX' for xbox.. its some cryptic number.. |
Easy to do, look at the earthcal.tcl script I just did, it uses index numbers from the remote website as well. Just make a list with the name:number and then a small search proc to look up the corresponding number for a particular name..
The weather script I (re)did also uses a similar search function to look up weather WMO codes or country names (does it both ways, code to country, or country to code.) |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sat Oct 28, 2006 8:08 pm Post subject: "modify" incith-google.tcl |
|
|
Hi,
I'd like to 'delete' links given by "!google define" command, that is:
- !g define:eggdrop
- Eggdrop is a popular IRC bot. It was originally written in the December of 1993 by Robey Pointer to watch a single channel. It is written in the C programming language, and features an interface for scripts that allow the user to enhance the functionality of the bot. The language used in the script interface is Tcl. @ http://en.wikipedia.org/wiki/Eggdrop&usg=__th4rmhJ1-JzdBt8l8ehu_r1sHMk= (http://www.google.com/search?hl=all&q=define:eggdrop )
I want that links not to be displayed, I want just the definition, is it possible (and easy please ) ?
Thanks |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Oct 31, 2006 12:37 am Post subject: |
|
|
Yeah.. I too have noticed that lately google is adding bullshit to the end of definition links, effectively breaking them.
I've spotted two useless url tags so far and removed them..
http://en.wikipedia.org/wiki/Eggdrop&usg=__th4rmhJ1-JzdBt8l8ehu_r1sHMk= (http://www.google.com/search?hl=all&q=define:eggdrop
here's the fix: | Code: | # define:
} elseif {[string match "define:*" $input] == 1} {
regexp -- {<li>(.+?)(?=\s*<li>|<br>).*<a href.*(http.+?)">} $html - desc link
regsub -- {<li>(.+?)(?=\s*<li>|<br>)} $html {} html
regsub -all -- {\+} $input {%2B} define_input
regsub -all -- { } $define_input {+} define_input
if {[info exists link] == 1} {
regsub -all " " $link "%20" link
regexp -- {(.+?)\&sig=} $link - link
regexp -- {(.+?)\&usg=} $link - link
append link " ( http://www.google.com/search?hl=${incith::google::language}&q=${define_input} )"
} | The change above will only remove the bullshit off the end of the link, the red part.
@fly: To completely remove the link (also removes the @ which you didn't include but I know you meant to) change the define section like below: | Code: | # define:
} elseif {[string match "define:*" $input] == 1} {
regexp -- {<li>(.+?)(?=\s*<li>|<br>).*<a href} $html - desc
regsub -- {<li>(.+?)(?=\s*<li>|<br>)} $html {} html
regsub -all -- {\+} $input {%2B} define_input
regsub -all -- { } $define_input {+} define_input
set link "" |
|
|
| Back to top |
|
 |
|
|
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
|
|