Author Topic: Google Script  (Read 2267 times)

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« on: March 08, 2009, 08:21:18 PM »
Quote from: EKLIPz
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.

[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Google Script
« Reply #1 on: March 09, 2009, 11:15:13 AM »
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.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #2 on: March 09, 2009, 12:07:05 PM »
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.
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Google Script
« Reply #3 on: March 09, 2009, 12:57:57 PM »
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.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Google Script
« Reply #4 on: March 10, 2009, 01:12:14 PM »
A. We didn't forget about it, it couldn't have been done easily.
B. Would other search engines work? (ex. Dogpile?)
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #5 on: March 10, 2009, 01:14:17 PM »
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 > *
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Google Script
« Reply #6 on: March 11, 2009, 10:39:14 AM »
I was in the process of working on flood protection for it, but I'll get to testing it later on.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #7 on: March 11, 2009, 08:46:13 PM »
[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.

Code: [Select]
'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.
« Last Edit: March 11, 2009, 08:46:57 PM by EKLIPz »
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #8 on: March 11, 2009, 10:11:11 PM »
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
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Reason

  • Global Moderators
  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • http://Rev77.net/FailBot/latest.zip
Google Script
« Reply #9 on: March 12, 2009, 05:40:44 AM »
With all the gnome scripts around, I might make one of my own, FailGnome!
Quote
04:37:18 PM | ?Swamp_Demon15@Azeroth? make me 1..?
04:37:28 PM | ?MikeA@Azeroth? can you code in VB6, lol?
04:37:47 PM | ?MikeA@Azeroth? And do you know how to have sex while hanging from your little toe?
04:38:01 PM | ?MikeA@Azeroth? If no to either, I'm sorry, we can't take you.
04:38:11 PM | ?MikeA@Azeroth? Joel taught us all the second one.

Hale_

  • Global Moderators
  • Full Member
  • ***
  • Posts: 205
    • View Profile
    • http://
Google Script
« Reply #10 on: March 13, 2009, 06:38:04 AM »
Don't create two Threads with the same thing. Merged Topics.
You noobs don't got the skillz tha killz.
Quote
[07:00:10 PM] <Hale_> Does no one talk in here?
[07:00:23 PM] <qazwsxedc> we talk in emotes
[07:00:25 PM] <qazwsxedc> use /me.
[07:00:29 PM] <Hale_ >
[07:00:29 PM] Hale_ was banned by TDAHelper (Emotes are not allowed).
[07:00:29 PM] TDAHelper kicked you out of the channel!

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #11 on: March 13, 2009, 10:06:06 AM »
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.
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Hale_

  • Global Moderators
  • Full Member
  • ***
  • Posts: 205
    • View Profile
    • http://
Google Script
« Reply #12 on: March 13, 2009, 08:05:05 PM »
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.
« Last Edit: March 13, 2009, 08:06:06 PM by Hale_ »
You noobs don't got the skillz tha killz.
Quote
[07:00:10 PM] <Hale_> Does no one talk in here?
[07:00:23 PM] <qazwsxedc> we talk in emotes
[07:00:25 PM] <qazwsxedc> use /me.
[07:00:29 PM] <Hale_ >
[07:00:29 PM] Hale_ was banned by TDAHelper (Emotes are not allowed).
[07:00:29 PM] TDAHelper kicked you out of the channel!

EKLIPz

  • Graphics Moderators
  • Newbie
  • *
  • Posts: 33
    • View Profile
Google Script
« Reply #13 on: March 13, 2009, 08:22:38 PM »
No, one was a project for a gnome bot, one was a request for a google search. Totally different.
[div align=\'center\'][img]http://ekreationz.comuf.com/img/mygfx/eklipzsig.gif\" border=\"0\" class=\"linked-sig-image\" /]
Hai Thair!!![/div]
I am the Secret Mod no one knows about. Who am i?
O_O Who is hiding in my sig? - EKLIPz
idk but its not me
so I got two people in my sig then? >.> - EKLIPz
~Actually there are three including me.
Holy crap...You guys are like ninjas - EKLIPz

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Google Script
« Reply #14 on: March 14, 2009, 09:25:54 AM »
Gah, I feel like tardiness will cost me one.

Try this out. So far, it just returns results, with a link to each result:

Code: [Select]
'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), "&nbsp;</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("&quot;", "<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
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector