string Cookies = string.Empty;

        /// <summary>
/// 获取在线人数 (51.la统计器)
/// </summary>
/// <param name="siteid">站点ID</param>
string TongJi_51La(string siteid)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.51.la/report/1_main_online.asp?id=" + siteid,
Cookie = "AJSTAT_ok_pages=1; AJSTAT_ok_times=1; ajid=lookpass%5F16680845=8444135851201a0b86b68c66ac8eabb3",
ContentType = "application/x-www-form-urlencoded"
};
HttpResult result = http.GetHtml(item);
Match mc = Regex.Match(result.Html, "innerHTML = '(\\d+)");
return mc.Groups[].Value;
} /// <summary>
/// 获取在线人数 (CNZZ统计器)
/// </summary>
/// <param name="siteid">站点ID</param>
/// <param name="pws">独立密码</param>
/// <returns></returns>
string TongJi_CNZZ(string siteid, string pws)
{
//万能框架对象
HttpHelper http = new HttpHelper();
//获取登录页面Cookie
HttpItem item = new HttpItem() { URL = "http://new.cnzz.com/v1/login.php?siteid=" + siteid };
HttpResult result = http.GetHtml(item);
Cookies = HttpHelper.GetSmallCookie(result.Cookie);
//登录
item = new HttpItem()
{
URL = "http://new.cnzz.com/v1/login.php?t=login&siteid=" + siteid,
Method = "POST",
Postdata = "password=" + pws,
Cookie = Cookies,
ContentType = "application/x-www-form-urlencoded",
Allowautoredirect = true,
AutoRedirectCookie = true
};
result = http.GetHtml(item);
Cookies += HttpHelper.GetSmallCookie(result.Cookie);
//获取15分钟在线IP
item = new HttpItem()
{
URL = "http://tongji.cnzz.com/main.php?c=flow&a=realtime&ajax=module=flash&type=Pie&siteid=" + siteid,
Cookie = Cookies,
ContentType = "application/x-www-form-urlencoded"
};
result = http.GetHtml(item);
Match mc = Regex.Match(result.Html, "total_ip\":(\\d+)");
return mc.Groups[].Value;
}
        /// <summary>
/// 获取在线人数 (CNZZ统计器)
/// </summary>
/// <param name="siteid">站点ID</param>
/// <param name="pws">独立密码</param>
/// <returns></returns>
string TongJi_CNZZ(string siteid, string pws)
{
//万能框架对象
HttpHelper http = new HttpHelper();
//登录
HttpItem item = new HttpItem()
{
URL = "http://new.cnzz.com/v1/login.php?t=login&siteid=" + siteid,
Method = "POST",
Postdata = "password=" + pws,
ContentType = "application/x-www-form-urlencoded",
Allowautoredirect = true,
AutoRedirectCookie = true
};
HttpResult result = http.GetHtml(item);
string Cookies = HttpHelper.GetSmallCookie(result.Cookie);
//获取15分钟在线IP
item = new HttpItem()
{
URL = "http://tongji.cnzz.com/main.php?c=flow&a=realtime&ajax=module=flash&type=Pie&siteid=" + siteid,
Cookie = Cookies,
ContentType = "application/x-www-form-urlencoded"
};
result = http.GetHtml(item);
Match mc = Regex.Match(result.Html, "total_ip\":(\\d+)");
return mc.Groups[].Value;
}

获取在线人数 CNZZ 和 51.la的更多相关文章

  1. 屏蔽全部统计代码(51.la cnzz 百度统计 谷歌分析师adsense、屏蔽淘宝客广告代码)的方法

    支持百度统计 .51.la统计.cnzz统计.51yes统计.谷歌分析师.阿里妈妈淘宝客广告.chinaz弹窗.假设有很多其它的须要屏蔽的,欢迎联系 default7#zbphp.com 改动etc的 ...

  2. 日志分析方法概述 & Web日志挖掘分析的方法

    日志在计算机系统中是一个非常广泛的概念,任何程序都有可能输出日志:操作系统内核.各种应用服务器等等.日志的内容.规模和用途也各不相同,很难一概而论. 本文讨论的日志处理方法中的日志,仅指Web日志.其 ...

  3. 网站PV、UV以及查看方法

    网站PV.UV以及查看方法 一.名词解释 PV:PV 是Page Views的缩写,即页面浏览量,用户每一次对网站中的每个网页访问均被记录一次.注意,访客每刷新一次页面,pv就增加一次. UV:UV是 ...

  4. struts2学习笔记(二)—— 获取登录信息及计算在线人数

    实现目的:       1.点击"Login"的超链接.进入登录页面       2.填写登录信息.提交表单,将用户信息保存进Session       3.显示用户名,并计算在线 ...

  5. python爬虫——爬取B站用户在线人数

    国庆期间想要统计一下bilibili网站的在线人数变化,写了一个简单的爬虫程序.主要是对https://api.bilibili.com/x/web-interface/online返回的参数进行分析 ...

  6. 开发笔记—钉钉服务商应用isv开发,从应用配置,到获取客户企业通讯录

    以第三方企业微应用为例 在第三方企业微应用应用时,比较底层的需求,就是应用需要获取客户企业的通讯录,即部门/员工的数据.本人整理以下几个关键数据,供大家开发参考. 新建第三方微应用时,能拿到这些初始数 ...

  7. JS 获取(期号、当前日期、本周第一天、最后一天及当前月第一、最后天函数)    

    JS 获取(期号.当前日期.本周第一天.最后一天及当前月第一.最后天函数 /** 2 * 获取当前月期号 3 * 返回格式: YYYY-mm 4 * / 5 function getCurrentMo ...

  8. 异步网页采集利器CasperJs

    在采集网页中,我们会经常遇到采集一些异步加载页面的网页,我们通常用的httpwebrequest类就采集不到了,这个时候我们通常会采用webbrowser来辅助采集,但是.net下自带的webbrow ...

  9. 我的博客 Hexo 还是Jekyll

    我的博客 Hexo 还是Jekyll 标签(空格分隔): 博客 很喜欢找一些博客主题,目前发现几个比较不错的 Hexo: 阿里中间件 我的个人博客-Material主题 我的个人博客-Fluid主题 ...

随机推荐

  1. 【转】oracle job相关内容

    每天凌晨2点执行是这样的 dbms_job.submit(v_job,'lv;',TRUNC(sysdate+1)+2/24,'TRUNC(sysdate+1)+2/24'); 还有定义JOB最好是这 ...

  2. matlab 相同函数名解决

    http://jingyan.baidu.com/article/1612d500a23a8ce20e1eee07.html

  3. EL 表达式 取值将 < 转成 &1t 问题

    因为用JeeCMS,JeeCMS后台会存入<p></p> 内容到数据库中 用play框架取后台值的时候 用的EL表达式在前台展示 出现将< 转成 &1t HTML ...

  4. 【avalon源码】scpCompile

    function noop() {} function scpCompile(array) { return Function.apply(noop, array) } // var fn = new ...

  5. 使用ingress qdisc和ifb进行qos

    ifb   The Intermediate Functional Block device is the successor to the IMQ iptables module that was ...

  6. java CAS

    在Doug Lea提供的cucurenct包 (J.U.C)中,CAS理论是实现整个java包的基石.   Compare and Swap 在这里,CAS 指的是现代 CPU 广泛支持的一种对内存中 ...

  7. lost+found目录

    If you run fsck, the filesystem check and repair command, it might find data fragments that are not ...

  8. WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8

    转载自:http://blog.ready4go.com/blog/2013/05/18/resolve-android-ndk-warning-app-platform-android-14-is- ...

  9. Linux下使用fdisk发现磁盘空间和使用mount挂载文件系统

    若在安装Linux系统时没有想好怎么使用服务器,开始时只分了一部分给根目录.后面需要再使用时,可以通过几下一步进行分区和挂载文件系统. 看磁柱数使用情况 fdisk -l Disk /dev/sda: ...

  10. iOS学习笔记---oc语言第六天

    Block .数组高级 block本质上就是匿名函数(没有名称的函数) block语法和函数指针很相似 回顾函数 函数:C语⾔中,实现某一类功能的代码段. 完整的函数包含两部分:函数声明.函数定义 函 ...