21
Requests / Write to webpage
« Last post by Ace on March 15, 2009, 06:26:37 AM »Quote from: Reason
hmmm...
gimme a day or so i'll see what i can do.
You'll need to have a mysql database i can use though
Don't have one
hmmm...
gimme a day or so i'll see what i can do.
You'll need to have a mysql database i can use though
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...
Please note every beta is registered to YOUR computer using your login name and your computer name to insure you don't hand it out to people who aren't beta testers..do I need to crack it some then?
To Get a Random user in the channel you would doAnother Example
%channel(%rand(%co))
Explanation:
%channel (integer)
Gets user name of the user in the position Integer in the channel
%rand (integer)
Gets a random number with integer being the max
%co
The current channel count
To get a random users clanOr like hero and i were talkinga bout being able to make your own variables to replace current ones so like you could make
%channel(%rand(%co)).clan
or to get a ping
%channel(%rand(%co)).ping
'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