Recommended: How to access multiple domain names in one website space A piece of ASP code that can enable access to multiple domain names in a website space: The following is the referenced content: %if Request.ServerVariables(SERVER_NAME)=&q
Whenever Alexa ranking is updated, I need to sort out the rankings of all related similar websites and see the ranking updates of these rival websites. I have done more, and I feel annoyed. Although I have only more than 30 websites, I feel a little tired after watching them one by one. Therefore, I wonder if I can use a program to read its ranking data.
I used to remember that on a website with a complete list of websites, there is also the world ranking of this website after the name of a website. I believe it must be read by the program, otherwise I would be exhausted if I checked one by one. However, after browsing all the alexa websites, I have not found a way to get the ranking data directly. Although it provides some code, such as:, the number of the image cannot be read.
Later, I want to read the page without using xmlhttp and then cut out that number? Trouble is a little troublesome, maybe you can give it a try. So I started to view the two pages that showed the ranking.
| The following is the quoted content: http://www.alexa.com/data/details/@url=www.itlearner.com and http://www.alexa.com/data/details/traffic_details@q=! amp; url=www.itlearner.com, view the source file, search for traffic rank for, the ranking of my website is as follows: <ti><bbip><traffic><today>4</today></traffic></bbip></ti>5<tprp><pyp><page views rank:><pyp>,</pyp></page views rank:></pyp></tprp><today>7</today><page views per user:><[email protected]><today>6</today></[email protected]></page views per user:><[email protected]><traffic rank for>1</traffic rank rank for></[email protected]>, plop, I saw that the code was big. I looked it up again and saw that the traffic rank is displayed: today 1 wk. avg. 3 mos. avg. 3 mos. change. Today and 1wk in the previous form are both represented in the above form. When it comes to 3 mos, which is the most critical data, it is indeed displayed directly with numbers. That's great! |
After analyzing the code before and after, I found that the code behind the data was unique </td><td class=bodybold align=center bgcolor=#ffffff><img, so I started programming.
The following source code example is for your reference:
| The following is the quoted content: <% private function bytes2bstr(vin) dim i, thischrcode, nextchrcode strreturn = for i = 1 to lenb(vin) thischrcode = ascb(midb(vin, i, 1)) if thischrcode < ! amp;h80 then strreturn = strreturn ! amp; chr (thischrcode) else nextchrcode = ascb(midb(vin, i 1, 1)) strreturn = strreturn ! amp; chr(clng(thischrcode) * !amp; h100 cint(nextchrcode)) i = i 1 end if next bytes2bstr = strreturn end function function geturl(url) set retrieval = server.createobject(microsoft.xmlhttp) with retrieval. open get, url, false, , . send geturl = .responsetext geturl = bytes2bstr(.responsebody) end with set retrieval = nothing end function The above is the general code for reading page code using xmlhttp function getalexarank(url) on error resume next dim tempstr, trueurl, x, keystr trueurl = http://www.alexa.com/data/details/traffic_details@q=! amp;url= ! amp; url tempstr=geturl(trueurl) keystr = </td><td class=bodybold align=center bgcolor=#ffffff><img tempstr = split(tempstr, keystr)(0) x = instrrev(tempstr,>) 1 tempstr = mid(tempstr, x) if err then getalexarank=err.description err.clear else getalexarank=tempstr end if end function |
The above is the data that reads the alexa website page, analyzes the code and then obtains rankings.
| The following is the quoted content: dim url url=www.itlearner.com The URL to query, do not add http://response.write(getalexarank2(url)) to output ranking data %> |
Hehe, in the future, there is no need to check the company's relevant website rankings one by one. You just need to put those websites in the program to let the program read them one by one.
Share: How to hide the real address of the picture Generally speaking, the image code of the website is like this. The following is the quoted content: img src=./attachments/test.jpg />