What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [request] Dictionary/Wiki/Urban Dictionary Script

[request] Dictionary/Wiki/Urban Dictionary Script
Author: Message:
muffinz
New Member
*


Posts: 4
Joined: Apr 2007
O.P. [request] Dictionary/Wiki/Urban Dictionary Script
Greetings to all the scripting gurus out there.

Would such a script be possible? I recall coming across irc bots that were scripted do this.

e.g. !define frog
This would draw up the definition of frog from an online dictionary which is concise and not too long winded.

e.g. !wiki frog
Provides a short description of the requested word from Wikipaedia and a link to it.

e.g. !slang technosexual
Provides the definition of the slang requested from Urban Dictionary.com perhaps the definition that has received the most thumbs up

Just my 2 cents, I thought that these scripts would make msn live more fun!
04-05-2007 02:11 AM
Profile E-Mail PM Find Quote Report
Rolando
Veteran Member
*****

Avatar
Santasend

Posts: 1325
Reputation: 52
33 / Male / Flag
Joined: Feb 2006
RE: [request] Dictionary/Wiki/Urban Dictionary Script
spleak can do this. spleak@hotmail.com.. unless you want a script.. I'm sure another member will look into it if that's what you want.
[Image: sigxmascopy.png]
04-05-2007 03:59 AM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [request] Dictionary/Wiki/Urban Dictionary Script
I have this script for wikipedia with me. It works only when you send the message. If you want, i can edit it again to make it respond to other's messages too.
code:
//Wikipedia Search Script, originally created by Paril, modified by ddunk.
//Edited by Felu(http://www.feluowns.com) for personal use.

var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var query;
var CurrentWindow;
var url;
var title;
var response;
var result;

function OnEvent_ChatWndSendMessage(pChatWnd, sMessage)
{   
    if(sMessage.substr(0,5) == "!wiki")
    {
        CurrentWindow = pChatWnd;
        query = sMessage.substr(6,sMessage.length);
        get_wikipedia_result(query);
        return "";       
    }
}


function get_wikipedia_result(query)
{
    xmlHttp.open("GET", "http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=" + query + "&fulltext=Search", true);
    xmlHttp.onreadystatechange = stateChanged;
    xmlHttp.send();
}       

function stateChanged()
{
    Debug.Trace(xmlHttp.readyState)
    if (xmlHttp.readyState==4)
    {
        Debug.Trace(xmlHttp.status)
        if (xmlHttp.status==200)
        {
            Debug.Trace("test")
            url = new RegExp("<li style=\"padding-bottom: 1em;\"><a href=\"(.*?)\"");
            title = new RegExp("<li style=\"padding-bottom: 1em;\"><a href=\".*?\" title=\"(.*?)\">");
            response = xmlHttp.responseText;
            result = response.match(url);
            title = response.match(title);
            if (result)
            {               
                CurrentWindow.SendMessage("Wikipedia search: " + query + "\n Result: " + title[1] + " - http://en.wikipedia.org" + result[1]);
            }
            else
                CurrentWindow.SendMessage("Wikipedia search for " + query + " returned no results");
        }
    }
}
04-05-2007 04:09 AM
Profile E-Mail PM Web Find Quote Report
muffinz
New Member
*


Posts: 4
Joined: Apr 2007
O.P. RE: [request] Dictionary/Wiki/Urban Dictionary Script
yes! Felu it would be great if other people could make use of the !wiki search function as well.

I'm not familiar with creating scripts, but I'll try to create one using your code and hope everything goes well. Thanks!!

This post was edited on 04-05-2007 at 12:06 PM by muffinz.
04-05-2007 11:52 AM
Profile E-Mail PM Find Quote Report
muffinz
New Member
*


Posts: 4
Joined: Apr 2007
O.P. RE: [request] Dictionary/Wiki/Urban Dictionary Script
okay i have just created it and its running fine now.

keyword entered: !wiki frog

Answer provided:
Wikipedia search: frog
Result: Frogs - http://en.wikipedia.org/wiki/Frogs

I was hoping that a short description could be added to that..
e.g.
keyword entered: !wiki frog  (This would show up on chat to show that someone has requested a search)

Answer Provided:
Wikipedia search: frog

Archaeobatrachia Mesobatrachia Neobatrachia - List of Anuran families The frog is an amphibian in the order Anura (meaning "tail-less" from Greek an-, without + oura, tail), formerly referred to as Salientia (Latin saltare, to jump). Adult frogs are characterised by long hind legs, a short body, webbed digits, protruding eyes and the absence of a tail. Most frogs...

http://en.wikipedia.org/wiki/Frogs to read more about it

saves from unnecessarily opening internet explorer window everytime a wikipedia search is done.

I've seen it on bots and was just wondering whether the exact script was created on msgplus.

Thanks again for the code Felu
04-05-2007 12:23 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