R77 Community Forum Archive
Programming => Scripting => Requests => Topic started by: EKLIPz on March 08, 2009, 08:21:18 PM
-
I am looking for a plugin that can use google to do a few things. If possible, these are the commands I would like.
Me: !gstats <search phrase> // Displays how many results are found for a given search.
Bot: Results 1 - 10 of about 200,000 for <search phrase>. (0.10 seconds)
Me: !gsearch <search phrase> // Displays top 3 links for search.
Bot: Link 1 -- www.link1.com
Bot: Link 2 -- www.link2.com
Bot: Link 3 -- www.link3.com
Me: !gsearch [fl] <search phrase> // Displays link for First Link aka Feeling Lucky
Bot: Link 1 -- www.link1.com
Me: !gplink // Takes last searched link, and inputs it into bot's profile.
Bot: Added link to profile.
Also, this will more then likely need some kind of flood control, to keep it from spamming or being abused. Thanks to whoever can do this.
-
Ahhh, the infamous google plugin. They don't like scInet, but I have a workaround.
Did ya check /r77 get googphone yet? I wrote one that could retrieve stats for a particular phone number xD
But yah, when I can, I will work on this.
-
Yea, I am very fond of the googphone plugin. Only thing that sucks, is 89% of the PN I try aren't in the database. Cell phone and Canadian #s don't work.
I also love fpFunPlugin.plug. Idk how it works, but that thing is "semi" close to what I want with this google plugin. Where, you ask it stuff, and it retrieves info from google. But can also get data on searches. But the fun plugin is super fast, which, I doubt the google plugin will be as fast, seeing as it has to actually google.
-
The queries into the google database are relatively fast. Only querying the search URL won't be as fast as querying a URL that doesn't require retrieval of information in a database.
-
A. We didn't forget about it, it couldn't have been done easily.
B. Would other search engines work? (ex. Dogpile?)
-
Nope. It's a google bot. (Googlism@USEast)
And Joel is kindly already working on it. I saw some working tests earlier today.
Thanks tho. If you want to make a "Dogpile" script, that is fine. But Google > *
-
I was in the process of working on flood protection for it, but I'll get to testing it later on.
-
[size=]GoogleGnome[/size]
This is kind of my way at attempting to learn VBS. I am not sure on all of the details, but, here is what I got so far.
GoogleGnome, much like the previous and current Gnomes, will go from channel to channel, collecting data. It will begin with very few channels. The data being collected is undetermined. I am trying to come up with something google related. If anyone can come up with and ideas, that would be great. Like I stated b4, this is a project for me to get an understanding of VBS and just the bot in general. I have never written a script, so, all help would be helpful. I have quite a few tutorials and help sites I am going by, and just generally looking at existing scripts to get some knowledge. If anyone is bored, and has time to blow, maybe I can get someone that knows VBS some to partner up with.
On to the script. My current tasks are creating a "GGnome" mode that will start its travel to channels.
This is the script I have so far.
'gg
'1.0
'&GoogleGnome Plugin By EKLIPz
'&
'&
'&My Scipting project.
Sub gg_Event_Load()
AddChat vbGreen, "EKLIPz' GoogleGnome v.01 plugin loaded."
End Sub
Sub blank_Event_Close()
AddChat vbCyan, "GoogleGnome closing."
End Sub
**Remember, this is not a request, I am not looking for someone to make this for me. Any help or tips is fine, and maybe a partner, but, other then that, this is my project.
-
Well, I skipped a step, and have set up a MySQL table for a channel list to visit. And A form for people to add their channel. Maybe eventually I will add something different, so I don't have random people adding channels, but this is fine for now. And once I get it all set up, maybe the bot can read from the DB on which channels to visit.
http://ekreationz.comuf.com/ggnome.php (http://ekreationz.comuf.com/ggnome.php)
-
With all the gnome scripts around, I might make one of my own, FailGnome!
-
Don't create two Threads with the same thing. Merged Topics.
-
Two totally different topics...ideas...and, ideas. Google Script is a plugin for searching google, which was a request, and Joel is working on it.
The Gnome was a project for me....and anyone that wanted to help, making it a "Group Project". And it was to help me learn VBS.
Should not have been merged.
-
It was two topics about the same thing. This one you just requested it and you requested it in the other one too, which kind of makes it the same thing.
-
No, one was a project for a gnome bot, one was a request for a google search. Totally different.
-
Gah, I feel like tardiness will cost me one.
Try this out. So far, it just returns results, with a link to each result:
'gp
'0.1
'&Google Plugin:Vector:Searches google, and returns the results of the search
'*
'*
'*
'*
'*Fun
Const gpAcc = 20
Public xmlGet, arrFloodProtect
Sub gp_Event_Load()
Set xmlGet = CreateObject("Microsoft.XmlHttp")
End Sub
Sub gp_Event_UserTalk(Username, Flags, Message, Ping)
GetDBEntry Username, a, f : If a < gpAcc Then Exit Sub
If Left(Message, Len(BotVars.Trigger) + 6) = BotVars.Trigger & "gfind " Then
getQuery = Right(Message, Len(Message) - (Len(BotVars.Trigger) + 6))
getQuery = Replace(getQuery, " ", "+")
Call retrieveResult(getQuery)
End If
End Sub
Sub retrieveResult(getQuery)
xmlGet.Open "GET", "http://www.google.com/search?hl=en&q="&getQuery&"&btnG=Google+Search&aq=f&oq=", False
xmlGet.Send ""
content = xmlGet.ResponseText
getNumResults = Split(Split(content, "Results ")(1), " </div>")(0)
getNumResults = strip(getNumResults)
AddQ getNumResults
parseResults = Split(Split(content, "Search Results")(1), "http://")
idx = -1
For i=0 to Ubound(parseResults)
getLink = Split(parseResults(i), """")(0)
If Len(getLink) > 25 Then
getLink = "http://" & Split(getLink, "/")(0) & " [link truncated]"
Else
getLink = "http://" & getLink
End If
If InStr(parseResults(i), "this.href,'','','res'") Then
getText = Split(parseResults(i), "this.href,'','','res'")(1)
getText = Split(getText, "</a>")(1)
getText = Replace(getText, "<a href""", "")
getText = Strip(getText)
getText = Trim(Left(getText, Len(getText) - 9))
If Len(getText) > 140 Then getText = Left(getText, 140) & " ..."
getElem = getText & " Link: " & getLink
idx = idx + 1
ReDim Preserve arrFloodProtection(idx)
arrFloodProtection(idx) = getElem
End If
Next
For i=0 to Ubound(arrFloodProtection)
AddQ arrFloodProtection(i)
Next
End Sub
Function strip(parseOutChars)
tagF = Array(""", "<b>", "</b>")
tagR = Array("""", "", "")
getTagCount = Ubound(Split(parseOutChars, "<"))
For i=1 to getTagCount
getTag = Split(Split(parseOutChars, "<")(i), ">")(0)
parseOutChars = Replace(parseOutChars, getTag, vbNullString, 1, 1)
Next
parseOutChars = Replace(parseOutChars, "<>", vbNullString)
i = 0
For each tag in tagF
parseOutChars = Replace(parseOutChars, tag, tagR(i))
i = i + 1
Next
strip = parseOutChars
End Function
-
It was two topics about the same thing. This one you just requested it and you requested it in the other one too, which kind of makes it the same thing.
Silly hale...
-
Double Posts are for Admins
-
Should we be posting gnome scripts that annoy the crap out of people sometimes? For the amount of people we could get, I go against it. You can send it via PM.