What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Accessing information from the internet

Accessing information from the internet
Author: Message:
ash44455666
New Member
*


Posts: 10
Joined: Aug 2007
O.P. Accessing information from the internet
I'm pretty sure it's possible, as I'm pretty sure I've seen similar tasks done by other scripts.  The problem is I don't know how they do it ^o)
Does anyone here know how to do this?  It is complicated?  If I confused you with what I'm trying to do, here's an example.

A user who is chatting with me types !google cough drops
The script somehow accesses/goes to/finds the first 3 matches of cough drops at
http://www.google.com/search?hl=en&q=cough+drops
and displays them on in the conversation.  Thanks to anyone who assists me :)
10-07-2007 04:55 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Accessing information from the internet
There are already a few scripts about that do what you want. One of which being "+Search" created by me, that allows you to add multiple search engines.

[Release] +Search (Version 1.2)

If you still want to go ahead and make your own, you can edit the source code and look for code regarding XMLHTTP (Google how to use XMLHTTP and it will explain it in detail)
<Eljay> "Problems encountered: shit blew up" :zippy:
10-07-2007 06:40 PM
Profile PM Find Quote Report
ash44455666
New Member
*


Posts: 10
Joined: Aug 2007
O.P. RE: Accessing information from the internet
Thank you, I'll take a look at your code and see what I can figure out.  The exact script I'm attempting to create is something for a game called RuneScape.  The commands would/will be !stats <username>, !quest <quest>, !clan <username> and maybe another or two.
10-07-2007 07:38 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Accessing information from the internet
quote:
Originally posted by SpunkyLoveMuff
Google how to use XMLHTTP
And ensure that the info you look at relates to Internet Explorer.
[Image: spartaafk.png]
10-07-2007 08:26 PM
Profile PM Web Find Quote Report
ash44455666
New Member
*


Posts: 10
Joined: Aug 2007
O.P. RE: Accessing information from the internet
function search(query, engine){
    var shell = new ActiveXObject("WScript.Shell");
    engine=engine.split("TEST");
    query = query.replace(/\s/gi,"+");
    shell.run(engine[0]+query+engine[1]);
}

how does this function work?  I don't really need a detailed description of every line of code.  What does 'query' need to be?  Would that be the what you're searching for at google?  Also, what would 'engine' have to be?  Also, will this be the only function I need to use, disregarding something to filter out what I need?

Edit:  I just tried out your code, but it doesn't retrieve information from the internet, it just goes to the appropriate website on the default web browser.  This is useful in some cases, but what I'm trying to do is have the script get the required information itself and bring it back to be said in the conversation.  Is this possible?

This post was edited on 10-07-2007 at 11:57 PM by ash44455666.
10-07-2007 11:51 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Accessing information from the internet
My bad... Thought it had the function in there... Got some spare time now so:

code:
function getInfo(){
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
        http_request.open('GET', "www.website.com", false);
        http_request.onreadystatechange = event;
        http_request.send();
}

function event(){
        if (http_request.readyState == 4) {
                if (http_request.status == 200) {
                        var response = http_request.responseText
            Debug.Trace(response);
            //Your code goes here
                    }
            }
    }


Sorry for the mix-up
<Eljay> "Problems encountered: shit blew up" :zippy:
10-08-2007 02:12 AM
Profile PM Find Quote Report
ash44455666
New Member
*


Posts: 10
Joined: Aug 2007
O.P. RE: Accessing information from the internet
Thanks once more, that mostly solved my problem.  However when I got the information it was all in HTML (or XML, don't really know the difference).  Is there a particular way to extract the information I need?  I read about XMLHTTTP using a Google search, but all I really got was the information on obtaining the web page's content :|
10-08-2007 02:15 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On