常德seo今天要讲到的是刷ALEXA 排名,先做一个简单介绍:
Alexa排名是指网站的世界排名,主要分为综合排名和分类排名,Alexa提供了包括综合排名、到访量排名、页面访问量排名等多个评价指标信息,大多数人把它当作当前较为权威的网站访问量评价指标。
2002年5月Alexa放弃了自己的搜索引擎转而与Google合作。
Alexa每天在网上搜集超过1,000GB的信息,然后进行整合发布,他搜集的网址链接数量已经超过了Google。
第一步,首先下载安装 alexa工具条,如果已经安装了,那跳过这一步即可。如果还没有安装,请下载安装。
第二步,确保 alexa工具条是可以工作的,xp 系统下有的时候alexa 工具条不能正常显示,解决办法是安装 一个 yahoo 助手,然后在上网助手中,选择“插件拦截”,打开后,在工具插件中,第一项就是“ALEXA 工具条”,选择它,然后在对话框底部,点“允许弹出”。
第三步,建立一个 alexa.htm页面,代码如下
<html>
<head>
<script language="javascript">
var nInterval;
function chkRefresh()
{
win=window.open("alexa.aspx","mzs","");
nInterval=setInterval("go()",15000);
}
function go()
{
if(win.closed==true){chkStop();}else{
win.location="alexa.aspx";}
}
function chkStop()
{
window.clearInterval(nInterval);
win.close();
}
</script>
</head>
<body>
<input type='button' id='btn' style="width:60px" value="开始刷" onclick="chkRefresh();">
<input type="button" value="停止刷" name="btnStopRefresh" onclick="chkStop();">
</body>
</html>
第四步,建立一个 alexa.aspx页面,html 代码
<html>
<head>
<title>alexa</title>
</head>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
</form>
<script language="javascript">
//每隔一定时间自动调用该页面,此时该页面用 ajax 随机调用数据库 url,从而实现 alexa 刷新
//debugger;
var dt = alexa.GetUrl().value.Tables[0];
if (dt.Rows.length > 0)
{
window.location.href=dt.Rows[0].url;
}
</script>
</body>
</html>
cs 代码
public class alexa : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Utility.RegisterTypeForAjax(typeof(alexa));
}
[AjaxMethod()]
public DataSet GetUrl()
{
DataSet ds = new DataSet();
string strConnection = System.Configuration.ConfigurationSettings.AppSettings["Conn Str"];
SqlConnection conn = new SqlConnection(strConnection);
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select top 1 * from alexa order by newid()";
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
conn.Close();
if(ds!=null)
{
return ds;
}
else
{
return null;
}
}
Web Form Designer generated code
}
第五步,可以用访问目录的方式,也可以用数据库的方式来读取 url,我这里是按数据库的方式来演示的,
建立一个表,结构如下
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[alexa]') and OBJECTPROPER TY(id, N'IsUserTable') = 1)
drop table [dbo].[alexa]
GO
CREATE TABLE [dbo].[alexa] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
第六步,把你网站的所有页面都录入到数据库,直接在查询分析器中用 in sert 语句,就不用录入页面了
第七步,开始用刷力量的工具刷流量