Google.Bot.v.1.0.LUA5-ZD
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Google.Bot.v.1.0.LUA5-ZD

Started by [ZD][Psycho], 28 September, 2005, 00:15:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[ZD][Psycho]


v1.1 can be downloaded from:
mirror 1
mirror 2
mirror 3
mirror 4

v1.0 can still be downloaded from here.
*Note: changelog.txt doesn't have an entry for the change I made to the script which will tell the user if his search didn't return any results.


To-add features:
?- [v1.2] !google command (would use a default amount of results to send back to the user)
?- [v1.2] Option to return the result's description along with the result instead of just title+url.
?- [v1.2] Top Searches feature (Got the idea from Dessamator's "SearchCount" script.)


Feel free to post any bugs or feature requests. Also, if you use this script, I'd definately like to know where you're using it. Feel free to send me a PM telling me which hub it's being used in.
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

GeceBekcisi

#1
Haven't tested script yet but idea is good usage of bluebear's pxwsa library. Congrulations...

But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

digi

[11:39] Syntax ...14-9\backup14-9\scripts\Google.Bot.v.1.0.LUA5-ZD.lua:31: attempt to call global `libinit' (a nil value)

this wht i get when run google script...  :rolleyes:

[ZD][Psycho]

#3
QuoteOriginally posted by digi
[11:39] Syntax ...14-9\backup14-9\scripts\Google.Bot.v.1.0.LUA5-ZD.lua:31: attempt to call global `libinit' (a nil value)

this wht i get when run google script...  :rolleyes:
Make sure pxwsa.dll is located in your ptokax directory (the backup14-9 folder in your case)
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

LoTeK_

QuoteOriginally posted by GeceBekcisi
Haven't tested script yet but idea is good usage of bluebear's pxwsa library. Congrulations...

But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?

Indeed.

[ZD][Psycho]

QuoteOriginally posted by GeceBekcisi
But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?
Yes, it would probably be better for the users to just do it that way. Although, if your server has the spare bandwidth, I don't really see any problem against the use of this bot. It might actually be easier to use this bot in one small sense:

Example of user searching google with the /g cmd:
User types in: /g keywords
Window pops up, takes user to google page.
User chooses the url he wishes to go to.

Example of user searching with the bot:
User types in !google (or !g if you want it short as possible) # keywords
User chooses the url he wishes to go to from the hub (no need for the user to go to google.)

But, either way, it's up to the hub owner's choice weither or not they want to run this script ;P

QuoteOriginally posted by Mutor
Maybe a few too many globals as well.
This is my first script ;P. Any suggestions are welcomed to improve it.

QuoteOriginally posted by Mutor
Still a fine effort and good example of using the socket library.

Keep up the good work [ZD][Psycho]
Thanks. I plan to make more scripts that make use of pxwsa.
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

Skippy84

i have translated the script into German  :]


@[ZD][Psycho] its a great script

(-=TrIp-iN-SuN=-)

your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D

bastya_elvtars

QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D

Now you are a moron. first you insult me in PM, are unable to understand that I will a release right after new PxWSA is released (since I cannot debug it as well with this one), then you start to ask every day like if I was the PxWSA developer but I got no exact bug reports from you either in PM or main.

P. S.: apologies for polluting your thread, [ZD][Psycho]. :(
Everything could have been anything else and it would have just as much meaning.

[ZD][Psycho]

QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
No errors? Are you doing the commands right?
Quotebut if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
I have no intentions on starting such a project when there is already such a project being worked on ;P.


QuoteOriginally posted by bastya_elvtars
P. S.: apologies for polluting your thread, [ZD][Psycho]. :(
Don't worry about it ;P
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

Psycho_Chihuahua

QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D


hmm funny, works fine here

[00:57:59] *** Server command: !google 5 lua forum
[00:58:00] *** Psycho_Chihuahua is googling for "lua forum". Type in !google 5 lua forum to search for the same.
[00:58:00] ****** The LUA Language Board - Main Page ---> [URL]http://board.univ-angers.fr/main.php[/URL]
[00:58:00] ****** DCEmu Forums The Worlds Best Dreamcast, PSP, Nintendo DS, Xbox 360 ... ---> [URL]http://www.dcemu.co.uk/vbulletin/forumdisplay.php?f=89[/URL]
[00:58:00] ****** DCEmu Forums The Worlds Best Dreamcast, PSP, Nintendo DS, Xbox 360 ... ---> [URL]http://www.dcemu.co.uk/vbulletin/archive/index.php/f-89.html[/URL]
[00:58:00] ****** The Ptokax LUA Language Board 
[00:58:00]  Main Page ---> [URL]http://lua.uknnet.com/[/URL]
[00:58:00] ****** Curse Gaming Forums - Checking if a player is online via lua? ---> [URL]http://forums.curse-gaming.com/archive/index.php/t-2319.html[/URL]
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bastya_elvtars

QuoteOriginally posted by [ZD][Psycho]
Quotebut if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
I have no intentions on starting such a project when there is already such a project being worked on ;P.

If you can look at it, feel free to edit, since all I did was plain conversion.
Everything could have been anything else and it would have just as much meaning.

witch

QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
r u sure that u instaled pxwsa.dll?
shoutstats and google bot works just fine for me too, EXELENT work guys!

 
Thx a lot 4 that  :P



bastya_elvtars

QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D

I was thinking of that this is a special conflict. I remember having problems like this with Kerio, what firewall/antivirus/antispyware/other are you using?
Everything could have been anything else and it would have just as much meaning.

GrinSlaW

hi
lovley script this one  8)

can you make so it when commands runs it comes in PM insteed of MAIN or a option so that you can choose

one more thing
can you delete so when a user uses the google bot it will not notify in main that this user search for bla bla

hope you understand me  :rolleyes:

cheers
.:: AcExtreme ::. | .:: AcPro ::.

[ZD][Psycho]

QuoteOriginally posted by GrinSlaW
hi
lovley script this one  8)

can you make so it when commands runs it comes in PM insteed of MAIN or a option so that you can choose

one more thing
can you delete so when a user uses the google bot it will not notify in main that this user search for bla bla

hope you understand me  :rolleyes:

cheers

I'll add options in the next version to do both of them, however I won't be able to do any work to the script any time soon (I've been pretty busy lately.)
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

[ZD][Psycho]

Google.Bot.v.1.1.LUA5-ZD has been released. First post edited with the details.
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

vadertje

1 Question what is the rightklick command for the  Google.Bot.v.1.0.LUA5-ZD

the other 1 don't work good >>  Google.Bot.v.1.1.LUA5-ZD

[ZD][Psycho]

QuoteOriginally posted by vadertje
1 Question what is the rightklick command for the  Google.Bot.v.1.0.LUA5-ZD
I didn't include any rightclick commands in Google.Bot.v.1.0.LUA5-ZD. I added the rightclicks in v1.1.
Quotethe other 1 don't work good >>  Google.Bot.v.1.1.LUA5-ZD
What's wrong with it? Do you mean the command called "Google.Bot.v1.1 by ZD Scripting Team." doesn't do anything? I just added that as more of an advertisement or something  :P
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

vadertje

wen i use the scipt and i restart scipts he disconect the users and i mus restart the hub again :S and wen i restart hub he giove a failre :S about the hub addy :S

1.0 works good but 1.1 not  :(

[ZD][Psycho]

QuoteOriginally posted by vadertje
wen i use the scipt and i restart scipts he disconect the users and i mus restart the hub again :S and wen i restart hub he giove a failre :S about the hub addy :S

1.0 works good but 1.1 not  :(
Try removing this at the very end of the v1.1 script:
function OnExit()
    WSA.Dispose()
end
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

Gx_lucas

yea my script 1.1 and 1.0 dosen't work too :/ I do all this thinks but is still nothing ;/ why ??
it's verison 1.0 in Google.Bot.v.1.0.LUA5-ZD.lua and i have install pxwsa.dll in Central Folder PtokaX, Why didn't work ?? i use command !google and text, its not working :/
    gCMD="!google" -- Command to use to google on google. No spaces! It should have a prefix infront of it, e.g. ! or +
    gMAX="5" -- Maximum amount of searches that can be returned to the user. Google can only return 100 results, although I highly wouldn't recommend going over 15 results.
    Host="www.google.com" -- No need to edit this, unless google changes their domain ;P


    libinit = loadlib("pxwsa.dll", "_libinit")
    libinit()


    function ChatArrival(user, data)
       data = string.sub(data,1,string.len(data)-1)
       _,_,cmd,num,qry = string.find(data, "%b<>%s("..gCMD..")%s(%d+)%s(.+)")
       if cmd == gCMD and num <= gMAX then
          s,e,usr=string.find(data, "<(%S+)>")
          SendToAll("*** "..usr.." is googling for \""..qry.."\". Type in "..gCMD.." "..num.." "..qry.." to search for the same.")
          gConvert()
          SrcPg=("/search?q="..qry.."&num="..num)
          NewSck()
          return 1
       elseif cmd == gCMD and num > gMAX then
          user:SendData("*** You may not use a higher number than "..gMAX..".")
          return 1
       end
    end

    function gConvert()
       qry=string.gsub(qry, "%%", "%%25")
       qry=string.gsub(qry, " ", "+")
       qry=string.gsub(qry, "%*", "%%2A")
       qry=string.gsub(qry, "%+", "%%2B")
       qry=string.gsub(qry, ",", "%%2C")
       qry=string.gsub(qry, "%-", "%%2D")
       qry=string.gsub(qry, "/", "%%2F")
       qry=string.gsub(qry, "%.", "%%2E")
       qry=string.gsub(qry, ":", "%%3A")
       qry=string.gsub(qry, ";", "%%3B")
       qry=string.gsub(qry, "<", "%%3C")
       qry=string.gsub(qry, "=", "%%3D")
       qry=string.gsub(qry, ">", "%%3E")
       qry=string.gsub(qry, "%?", "%%3F")
       qry=string.gsub(qry, "%[", "%%5B")
       qry=string.gsub(qry, "\\", "%%5C")
       qry=string.gsub(qry, "%]", "%%5D")
       qry=string.gsub(qry, "%^", "%%5E")
       qry=string.gsub(qry, "_", "%%5F")
       qry=string.gsub(qry, "{", "%%7B")
       qry=string.gsub(qry, "|", "%%7C")
       qry=string.gsub(qry, "}", "%%7D")
       qry=string.gsub(qry, "~", "%%7E")
       qry=string.gsub(qry, "!", "%%21")
       qry=string.gsub(qry, "#", "%%23")
       qry=string.gsub(qry, "&", "%%26")
       qry=string.gsub(qry, "'", "%%27")
       qry=string.gsub(qry, "%(", "%%28")
       qry=string.gsub(qry, "%)", "%%29")
       qry=string.gsub(qry, "@", "%%64")
       qry=string.gsub(qry, "`", "%%60")
    end

    function OnWsaConnected(errorCode,errorStr,sock)
       if errorCode then
          WSA.Close(sock)
          SendToNick(usr, "*** Failed to connect to "..Host..".")
       else
          local CMD="GET "..SrcPg.." HTTP/1.0\r\nHost: "..Host.."\r\nUser-Agent: Mozilla/4.0\r\n"..string.char(13,10)
          WSA.BeginSend(sock,CMD)
       end
    end

    function OnWsaSendComplete(errorCode,errorStr,sock,bytesSent)
       if errorCode then
          WSA.Close(sock)
          SendToNick(usr, "*** Failed to send data to "..Host..".")
       else
          WSA.BeginReceive(sock)
       end
    end

    function OnWsaDataArrival(errorCode,errorStr,sock,sdata,bytesRead)
       if not errorCode or (errorCode==10040 and prot==0) then
          DataRecv=DataRecv..sdata
          return 1
       else
          DataRecv=string.gsub(DataRecv, "", "")
          DataRecv=string.gsub(DataRecv, "
    ", "")
          DataRecv=string.gsub(DataRecv, "
    ", "")
          DataRecv=string.gsub(DataRecv, "'", "'")
          DataRecv=string.gsub(DataRecv, ">", ">")
          DataRecv=string.gsub(DataRecv, "

    ", "

    ")
          DataRecv=string.gsub(DataRecv, "/url?sa=U&start=%d&q=", "")
          DataRecv=string.gsub(DataRecv, "", ">")
             for url,name in string.gfind(DataRecv, "

    ]*)>([^<]*)") do
             SendToNick(usr, "****** "..(name or "failed").." ---> "..(url or "failed"))
          end
          DataRecv=""
          return 0
       end
    end

    function NewSck()
       _,_,sock=WSA.NewSocket(0)
       WSA.BeginConnect(sock,Host,80)
    end

    DataRecv=""


[ZD][Psycho]

QuoteOriginally posted by Gx_lucas
yea my script 1.1 and 1.0 dosen't work too :/ I do all this thinks but is still nothing ;/ why ??
it's verison 1.0 in Google.Bot.v.1.0.LUA5-ZD.lua and i have install pxwsa.dll in Central Folder PtokaX, Why didn't work ?? i use command !google and text, its not working :/
Is the script producing any errors? Check the "scripts" tab in your PtokaX GUI.
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

Gx_lucas

no is not ;/ but dosen't work ;/

[ZD][Psycho]

QuoteOriginally posted by Gx_lucas
no is not ;/ but dosen't work ;/
The only thing I can think of is you are using an older version of PtokaX. You must have PtokaX 0.3.3.21 or later.
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

SMF spam blocked by CleanTalk