What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] display alexa rank from my site in personal message

[Request] display alexa rank from my site in personal message
Author: Message:
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [Request] display alexa rank from my site in personal message
Yes, I noticed that with a few other websites, so I've written another script for you which takes the site's Alexa Rank straight off the website.
code:
var PSM = "Alexa Rank: %alexa%";
var URL = "http://www.gem-flash.com";

function OnEvent_Initialize(MessengerStart) {
    if (Messenger.MyStatus > 0) {
        OnEvent_Timer();
    }
}

function OnEvent_Signin(Email) {
    OnEvent_Timer();
}

function OnEvent_Timer(TimerId) {
    MsgPlus.AddTimer("UpdateTimer", 1800000);
    UpdateAlexaRankPSM();
}

function UpdateAlexaRankPSM() {
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET", "http://client.alexa.com/common/css/scramble.css", true);
    xmlhttp.send(0);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            var Scramble = xmlhttp.responseText;
            xmlhttp.open("GET", "http://www.alexa.com/data/details/traffic_details?url=" + encodeURI(URL), true);
            xmlhttp.send(0);
            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    var Rank = "";
                    var Raw = xmlhttp.responseText.match(/->(.*?)<\/span><b/)[1].match(/(?:"[^"]+")?>?[\d,]+<?/g);
                    for (var i = 0; i < Raw.length; i++) {
                        if (/^"([^"]+)">([\d,]+)<?$/.test(Raw[i]) && !new RegExp(RegExp.$1).test(Scramble)) Rank += RegExp.$2;
                        else if (/^>?([\d,]+)<?$/.test(Raw[i])) Rank += RegExp.$1;
                    }
                    Messenger.MyPersonalMessage = PSM.replace(/%alexa%/gi, Rank);
                }
            }
        }
    }
}
As before, change the red text to suit your needs. This script is slower than the other one because it has to load more data (including a nasty scrambler system 8-)), but the end result is that it reflects the same rank as the web page. Enjoy!

This post was edited on 09-26-2007 at 01:00 AM by phalanxii.
09-23-2007 12:56 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Request] display alexa rank from my site in personal message - by ezak on 09-20-2007 at 08:47 PM
RE: [Request] display alexa rank from my site in personal message - by phalanxii on 09-22-2007 at 08:11 AM
RE: [Request] display alexa rank from my site in personal message - by ezak on 09-22-2007 at 02:43 PM
RE: [Request] display alexa rank from my site in personal message - by Matti on 09-22-2007 at 04:15 PM
RE: [Request] display alexa rank from my site in personal message - by ezak on 09-22-2007 at 04:31 PM
RE: [Request] display alexa rank from my site in personal message - by Matti on 09-22-2007 at 04:44 PM
RE: [Request] display alexa rank from my site in personal message - by phalanxii on 09-23-2007 at 12:56 AM
RE: [Request] display alexa rank from my site in personal message - by ezak on 09-24-2007 at 01:46 PM


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