百度统计、cnzz刷搜索词和来路链接原理,统计工具推广广告方法
6718
作为个人网站站长,我们会关注流量统计工具的数据,那么就有人千方百计的想让自己的信息出现在统计工具里。经常在自己的统计后台看到买这个百度统计刷搜索词和来路链接/cnzz刷搜索词和来路链接的,本着能自己动手就不花钱的原则研究了一下,其实比较简单。
重点是百度统计和cnzz的id难的,我尝试过怕百度的搜索结果,服务器的域名,进一步挖掘id,都前功尽弃,导致代码放了两年没有施展空间。现在分享给大家学习,原理很简单,百度统计和cnzz推送就是一个简单的两次get。
代码是Python的,大家可以参考参考~~
百度统计刷搜索词和来路链接代码
import requests import time, datetime,re import random aa=int(time.time()) print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) ) keyword='站长图库(zzTuKu.com)' baidu_id='45be2d728a7c0afeca7f3272ab592ebe' reurl='http://www.zztuku.com/' header={ 'Connection':'keep-alive', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36', 'Accept':'image/webp,image/apng,image/*,*/*;q=0.8', 'Referer':reurl, 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'zh-CN,zh;q=0.9', 'Cookie':'cna=kdhFFLBy91ECAXE5QkrS5z3h; UM_distinctid=16762aa44002fd-065a87850ef3b4-333b5602-1fa400-16762aa44025c9', } header1={ 'Connection':'keep-alive', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36', 'Accept':'image/webp,image/apng,image/*,*/*;q=0.8', 'Host':'hm.baidu.com', 'If-None-Match': 'd70bc8a6b4ecf7b0a3586a0f0bcc532f', 'Referer': 'http://www.zztuku.com', 'Sec-Fetch-Dest': 'script', 'Sec-Fetch-Mode': 'no-cors', 'Sec-Fetch-Site':'cross-site' } url='https://hm.baidu.com/hm.gif' jshtml=requests.get('https://hm.baidu.com/hm.js?{}'.format(baidu_id) ,headers=header1) pattern = re.compile(r'hca:\'(.*?)\',conv') hac=pattern.findall(jshtml.text) print (hac[0],int(time.time())); payload = { 'hca': hac[0], 'cc': 1, 'ck': 1, 'cl': '24-bit', 'ds': '1549x872', 'vl': 150, 'ep': '619951,15568', 'et': 0, 'ja': 0, 'ln': 'zh-cn', 'lo': 0, 'lt': int(time.time()), 'rnd': random.randint(1,9999999999), 'si': baidu_id, 'su':'https://www.baidu.com/link?url=yTdMUfvKXbrLSKsXbdtiuh5Caw0rF6-12IL6SR0HrOy&wd={}&eqid=a0ebf1180000fe0e000000055edcb015'.format(keyword) , 'v': '1.2.74', 'lv': 3, 'sn': 57594, 'r': 0, 'ww': 1550, 'ct': '!!', 'tt': '站长素材-精品VIP商业建站源码资源素材分享之家 - 站长图库' } baidu=requests.get(url,headers=header, params=payload) print (baidu.text)
cnzz刷搜索词和来路链接代码
import requests import time, datetime import random aa=int(time.time()) print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) ) keyword='站长图库 www.zztuku.com' cnzz_id='1253637370' reurl='http://www.zztuku.com/' header={ 'Connection':'keep-alive', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36', 'Accept':'image/webp,image/apng,image/*,*/*;q=0.8', 'Referer':reurl, 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'zh-CN,zh;q=0.9', 'Cookie':'cna=kdhFFLBy91ECAXE5QkrS5z3h; UM_distinctid=16762aa44002fd-065a87850ef3b4-333b5602-1fa400-16762aa44025c9', } payload = { 'id':cnzz_id, 'r':'https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu&wd={}&oq={}&rsv_pq=df160dc800043b60&rsv_t=f4c2pYJqrGEXgUog1SrHIQ0dQ5Pyjmj5m5KoW5ArURscsl3LTWvvPndjrd4&rqlang=cn&rsv_enter=0'.format(keyword,keyword), 'lg':'zh-cn', 'ntime':aa, 'cnzz_eid':'1188536334-1539909621-null', 'showp':'1920x1080', 't':'站长素材-精品VIP商业建站源码资源素材分享之家 - 站长图库', 'umuuid':'16689d91ec147a-07c48b212fb5b1-333b5602-1fa400-16689d91ec2587', 'h':'1', 'rnd':random.randint(1,9999999999), } url='http://z1.cnzz.com/stat.htm' cnzz=requests.get('http://c.cnzz.com/core.php?web_id={}&show=pic&t=z'.format(cnzz_id),headers=header) cnzz=requests.get(url,headers=header, params=payload) print (cnzz.text)
PS:目前百度统计、CNZZ都没办法屏蔽这类刷关键词的有效手段,基本是只能等平台升级来解决了~~
本文网址:https://www.zztuku.com/index.php/detail-8978.html
站长图库 - 百度统计、cnzz刷搜索词和来路链接原理,统计工具推广广告方法
申明:如有侵犯,请 联系我们 删除。
您还没有登录,请 登录 后发表评论!
提示:请勿发布广告垃圾评论,否则封号处理!!