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:
ezak
New Member
*


Posts: 9
Joined: Sep 2004
O.P. [Request] display alexa rank from my site in personal message
is that possible to get alexa rank for my site in my personal message
thanks  in advice

This post was edited on 09-20-2007 at 08:48 PM by ezak.
09-20-2007 08:47 PM
Profile E-Mail PM Find Quote Report
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
Here's a quick script that should do the job:
code:
var PSM = "Alexa Rank: %alexa%";
var URL = "www.google.com";

function OnEvent_Initialize(MessengerStart) {
    if (Messenger.MyStatus > 0) {
        MsgPlus.AddTimer("UpdateTimer", 1800000);
        UpdateAlexaRankPSM();
    }
}

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

function UpdateAlexaRankPSM() {
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET", "http://xml.alexa.com/data?cli=9&dat=nsa&url=" + encodeURI(URL), true);
    xmlhttp.send();
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            Messenger.MyPersonalMessage = PSM.replace(/%alexa%/g, xmlhttp.responseText.match(/^145 (\d+)$/m)[1]);
        }
    }
}
This will update your PSM with your site's Alexa Rank every 30 minutes. Just change the highlighted red text to your own custom PSM (where "%alexa%" will display your site's ranking) and your website's URL.
09-22-2007 08:11 AM
Profile PM Find Quote Report
ezak
New Member
*


Posts: 9
Joined: Sep 2004
O.P. RE: [Request] display alexa rank from my site in personal message
ohh thats amazing phalanxii , thanks alot bro

but I think there is something wrong

my site rank now it 21,405
and with your scipts show thats is 22,956

whats wrong in this ?
and thanks alot for you help
09-22-2007 02:43 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [Request] display alexa rank from my site in personal message
What's your site? It sounds like a very weird phenomena that the script would display a different ranking. :-/
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-22-2007 04:15 PM
Profile E-Mail PM Web Find Quote Report
ezak
New Member
*


Posts: 9
Joined: Sep 2004
O.P. RE: [Request] display alexa rank from my site in personal message
my site is http://www.gem-flash.com
and you can see the rank here http://www.alexa.com/data/details/traffic_details?url=gem-flash.com
its show that
Gem-flash.com has a traffic rank of:  21,405


and you can see the script
[Image: alexa.png]

This post was edited on 09-22-2007 at 04:32 PM by ezak.
09-22-2007 04:31 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [Request] display alexa rank from my site in personal message
That's very strange indeed. However, it seems to be a problem with Alexa itself, because the data which the script tries to retrieve contains this faulty rank.

I just checked "google.be" too and there's a mismatch there too. Very strange... :S
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-22-2007 04:44 PM
Profile E-Mail PM Web Find Quote Report
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
ezak
New Member
*


Posts: 9
Joined: Sep 2004
O.P. RE: [Request] display alexa rank from my site in personal message
yes its working perfectly phalanxii (Y)(Y)
thanks alot for you help mate:o)
09-24-2007 01:46 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