快速提高CSDN访问量 - 附脚本初代机
生活随笔
收集整理的這篇文章主要介紹了
快速提高CSDN访问量 - 附脚本初代机
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
快速提高CSDN訪問量的方法
- 多寫常用知識點的博客,想辦法提高百度排名,注意標題不要寫的太復雜
- 寫國內(nèi)比較新的技術,中短期奇效,效果很好
- 成系列的寫技術文章,有利于增加評論,粉絲,中長期能夠大幅度提高日常訪問量
- 成系列的專欄,利于增加粉絲,亦能提高日常訪問量,同上
- 想辦法讓文章推薦到首頁,可在短時間內(nèi)增加訪問量,
- 大招:腳本,有一個已經(jīng)寫好了的腳本在最后,但是不建議
- 大招二,水軍,還可以獲得很多評論,然并卵,非常不建議
訪問CSDN的腳本-初代機
代碼使用簡介
- 在CSDN判定為攻擊時可以拋出異常,繼續(xù)下一次訪問,直到達到訪問次數(shù)
- 隨機睡眠時間,隨機抽取訪問列表,也可以通過列表內(nèi)容控制訪問博客
- 各類參數(shù)已經(jīng)設置默認值,原始默認值運行結(jié)果良好
- csdn.start()的maxTime參數(shù)是默認整個列表的訪問次數(shù),具體訪問量為: maxTime*len(self.blog_url)
- 2017/08/05/ 更新
源碼
# - * - coding: utf - 8 -*- # # 作者:田豐(FontTian) # 創(chuàng)建時間:'2017/7/17' # 郵箱:fonttian@Gmaill.com # CSDN:http://blog.csdn.net/fontthrone import sysreload(sys) sys.setdefaultencoding('utf-8')import urllib2 import socket import time import re import randomblog_url =['http://blog.csdn.net/fontthrone/article/details/76675684','http://blog.csdn.net/FontThrone/article/details/76652772','http://blog.csdn.net/FontThrone/article/details/76652762','http://blog.csdn.net/FontThrone/article/details/76652753','http://blog.csdn.net/FontThrone/article/details/76652257','http://blog.csdn.net/fontthrone/article/details/76735591','http://blog.csdn.net/FontThrone/article/details/76728083','http://blog.csdn.net/FontThrone/article/details/76727466','http://blog.csdn.net/FontThrone/article/details/76727412','http://blog.csdn.net/FontThrone/article/details/76695555','http://blog.csdn.net/fontthrone/article/details/75805923', ]class CSDN(object):def __init__(self, blog_url=blog_url, csdn_url="http://blog.csdn.net/fontthrone"):self.blog_url = blog_urlself.csdn_url = csdn_urlself.headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11','Accept': 'text/html;q=0.9,*/*;q=0.8','Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3','Accept-Encoding': 'gzip','Connection': 'close','Referer': None}def openCsdn(self):req = urllib2.Request(self.csdn_url, headers=self.headers)response = urllib2.urlopen(req)thePage = response.read()response.close()pattern = "訪問:<span>(\d+)次</span>"number = ''.join(re.findall(pattern, thePage))return numberdef openBlog(self, link='http://blog.csdn.net/fontthrone/article/details/70556507', timeout=60, sleepTime=22,maxTryNum=1):tries = 0maxNum = 0# for tries in range(maxTryNum):while tries < maxTryNum:try:socket.setdefaulttimeoutreq = urllib2.Request(link, None, self.headers)resp = urllib2.urlopen(req, None, timeout)html = resp.read()print "Success!\t",print "Rest ", sleepTime, " seconds to continue...\n"tries += 1time.sleep(sleepTime)except:if tries < (maxTryNum):maxNum += 1print("Has tried %d times to access blog link %s, all failed!", maxNum, link)continueelse:print("Has tried %d times to access blog link %s, all failed!", maxNum, link)breakdef start(self, maxTime=100, blOpenCsdn=False, sleepTimeMin=15, sleepTimeMax=60, timeout=60):# 在此處修改默認的參數(shù),[sleepTimeMin,sleepTimeMax],為最小和最大睡眠時間,具體時間由隨機數(shù)控制# timeout 為url訪問的最大等待時間# 訪問列表是隨機訪問的,maxTime 為訪問列表的迭代次數(shù),每次迭代的具體數(shù)量 = len(urlList),因為每次訪問都是隨機的,一輪結(jié)束后,可能并非是每一個鏈接都被訪問了一遍,for i in range(maxTime * len(self.blog_url)):randomLink = random.choice(self.blog_url)print 'This tinme the random_blog link is ', randomLinkif blOpenCsdn == True:self.openCsdn()self.openBlog(link=randomLink, sleepTime=random.uniform(sleepTimeMin, sleepTimeMax), timeout=timeout)print "Now is " + str(i + 1) + " times to acess blog link\n"csdn = CSDN() inputMaxTime = input(u'請輸入列表訪問次數(shù) :\n') csdn.start(maxTime=int(inputMaxTime))所有使用我寫的腳本的童鞋,評論666再走,滑稽(手動輸入SVIP限定版)
- 既然有初代機自然也就有二代機,嘿嘿
- 老鐵,這都沒毛病
總結(jié)
以上是生活随笔為你收集整理的快速提高CSDN访问量 - 附脚本初代机的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Pandas to_json() 中文乱
- 下一篇: 机器学习常见算法汇总