国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
Python爬取微信公眾號(hào)歷史文章數(shù)據(jù)進(jìn)行分析,發(fā)現(xiàn)2017年運(yùn)營(yíng)總結(jié),可以這樣寫(xiě)!

作者:劉曉明,互聯(lián)網(wǎng)公司運(yùn)維技術(shù)負(fù)責(zé)人,擁有10年的互聯(lián)網(wǎng)開(kāi)發(fā)和運(yùn)維經(jīng)驗(yàn)。一直致力于運(yùn)維工具的開(kāi)發(fā)和運(yùn)維專家服務(wù)的推進(jìn),賦能開(kāi)發(fā),提高效能。 廣告時(shí)間:最后給自己代個(gè)鹽~~歡迎大家有空時(shí)翻下我牌子(知乎號(hào):布道 ),看看“開(kāi)發(fā)運(yùn)維”專欄的文章,希望多些關(guān)注和點(diǎn)贊是給作者最好的鼓勵(lì) !

2017年轉(zhuǎn)眼之間就過(guò)完,心挺累,人挺煩,想想都是為了錢(qián)。今天,我們以CSDN公眾號(hào)為例,用Python看看2017年公眾號(hào)運(yùn)營(yíng)都做了啥?

微信公眾號(hào)的文章爬取有三種方式:

a. 通過(guò)微信訂閱號(hào)在發(fā)布文章,可以查找公眾號(hào)的文章,方式見(jiàn)微信鏈接。,閱讀數(shù)、點(diǎn)贊數(shù)、評(píng)論數(shù)仍無(wú)法抓取。

b. 通過(guò)搜狗微信搜索微信公眾號(hào),但是文章篇幅仍然后有限制,點(diǎn)贊、閱讀數(shù)、和評(píng)論數(shù)無(wú)法抓取。

c. 通過(guò)“中間人方式”對(duì)數(shù)據(jù)進(jìn)行攔截,過(guò)濾解析后進(jìn)行抓取。

本文就時(shí)利用第三種c方式對(duì)數(shù)據(jù)進(jìn)行抓取。

思路:

1. 安裝代理AnProxy,在手機(jī)端安裝CA證書(shū),啟動(dòng)代理,設(shè)置手機(jī)代理;

2. 獲取目標(biāo)微信公眾號(hào)的__biz;

3. 進(jìn)入微信公眾號(hào)的歷史頁(yè)面;

4. 使用Monkeyrunner控制滑屏;獲取更多的歷史消息;

5. 記錄文章標(biāo)題,摘要,創(chuàng)建時(shí)間,創(chuàng)作類型,地址等等;

6. 文章列表獲取完成后,利用Monkeyrunner進(jìn)入文章的列表,

7. 記錄文章的閱讀數(shù),點(diǎn)贊數(shù),評(píng)論數(shù)等;

8. 重復(fù)以上操作。

數(shù)據(jù)爬取結(jié)果(數(shù)據(jù)截止:2017-12-26)



CSDN微信公眾號(hào)文章列表



(備注:如需要數(shù)據(jù)源請(qǐng) 知乎 關(guān)注“布道”,私信向我索取。有公眾號(hào)文章爬取需求的亦可聯(lián)系我!

數(shù)據(jù)分析

文章發(fā)布數(shù)量分析:

文章總數(shù):914篇,每個(gè)月發(fā)布情況如下:

import pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin1.xlsx',encoding= 'utf-8',header=1,names=name,)df['文章數(shù)'] = pd.to_datetime(df['日期']).dt.monthdate = pd.DataFrame(df['文章數(shù)'].value_counts())plt.figure(figsize=(15, 5))plt.title('CSDN公眾號(hào)文章發(fā)布情況')plt.xlabel('月份')plt.ylabel('文章數(shù)')plt.xticks((1,2,3,4,5,6,7,8,9,10,11,12),('2017-01','2017-02','2017-03','2017-04','2017-05','2017-06','2017-07','2017-08','2017-09',                                         '2017-10','2017-11','2017-12'))plt.plot(date.sort_index(),color='green',linestyle='dashed', marker='o', markerfacecolor='blue', markersize=8,)plt.show()



CSDN公眾號(hào)發(fā)布情況



通過(guò)發(fā)布文章次數(shù)的曲線來(lái)看,CSDN在4月份的才正式確定運(yùn)營(yíng)微信公眾號(hào),在11月份和12月份月發(fā)布次數(shù)已經(jīng)超過(guò)100篇,每天6篇文章已經(jīng)成為常態(tài),小姐姐確實(shí)不容易啊,手動(dòng)點(diǎn)贊!創(chuàng)作類型分析:

import pandas as pdimport matplotlib.pyplot as pltimport pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin1.xlsx',encoding= 'utf-8',header=1,names=name,)data = pd.DataFrame(df['創(chuàng)作類型'].value_counts())explode=[0,0,0,0,0]plt.figure(figsize=(15, 6))plt.axes(aspect=1)plt.title('文章創(chuàng)作情況',fontsize=18)plt.pie(x=data,autopct='%.2f%%',explode=explode,shadow=True,labels=['原創(chuàng)','未標(biāo)記作者','創(chuàng)作或轉(zhuǎn)發(fā)','其它','未知'])plt.show()



文章創(chuàng)作情況比例分布



通過(guò)文章的創(chuàng)作情況來(lái)看,一半以上的文章都是原創(chuàng)。基本上每天至少有一篇原創(chuàng)的文章。

有這樣的文采,確實(shí)是難得的人才。

閱讀數(shù)分析:

import pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin.xlsx',encoding= 'utf-8',header=1,names=name,)data = df[['閱讀數(shù)']]a = data.sort_values(by=['閱讀數(shù)'],ascending=False)one = a[a['閱讀數(shù)']>=70000].sizetwo = a[(a['閱讀數(shù)']>=30000) & (a['閱讀數(shù)']<70000)].sizethree =="" a[(a['閱讀數(shù)']="">=10000) & (a['閱讀數(shù)']<30000)].sizefour =="" a[(a['閱讀數(shù)']="">=1000) & (a['閱讀數(shù)']<10000)].sizefive ==""><1000)].sizeexplode=[0.3,0,0,0,0]fras =="" [one,two,three,four,five]plt.figure(figsize="(15," 5))plt.axes(aspect="1)" plt.title('閱讀數(shù)分布比例',fontsize="">



閱讀數(shù)分布比例



import pandas as pdimport matplotlib.pyplot as pltimport pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin1.xlsx',encoding= 'utf-8',header=1,names=name,)df_read = df[['標(biāo)題','閱讀數(shù)']]data_read = df.sort_values(by=['閱讀數(shù)'],ascending=False)data_read.index = data_read['標(biāo)題']var = data_read['閱讀數(shù)'][:10]plt.figure(figsize=(15, 6))plt.title('閱讀數(shù) TOP10 的文章',fontsize=18)plt.xlabel('數(shù)量',fontsize=18)plt.ylabel('標(biāo)題',fontsize=18)var.plot(kind='barh', stacked=True,alpha=0.5, color=['red'])plt.show()



閱讀數(shù)TOP10的文章



由于閱讀數(shù)超過(guò)10W,返回值為100001,具體數(shù)字是多少,前后臺(tái)不得而知。整體文章質(zhì)量比較高,不乏有10萬(wàn)+的文章出現(xiàn)。大V,對(duì)技術(shù)資訊的傳播具有很大的影響力!

點(diǎn)贊數(shù)分析:

import pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin.xlsx',encoding= 'utf-8',header=1,names=name,)data = df[['點(diǎn)贊數(shù)']]a = data.sort_values(by=['點(diǎn)贊數(shù)'],ascending=False)one = a[a['點(diǎn)贊數(shù)']>=200].sizetwo = a[(a['點(diǎn)贊數(shù)']>=50) & (a['點(diǎn)贊數(shù)']<200)].sizethree ==""><50)].sizeexplode=[0.3,0,0]fras =="" [one,two,three]plt.figure(figsize="(15," 5))plt.axes(aspect="">



點(diǎn)贊數(shù)分布比例



import pandas as pdimport matplotlib.pyplot as pltimport pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin1.xlsx',encoding= 'utf-8',header=1,names=name,)df = df[['標(biāo)題','點(diǎn)贊數(shù)']]data = df.sort_values(by=['點(diǎn)贊數(shù)'],ascending=False)data.index = data['標(biāo)題']var = data['點(diǎn)贊數(shù)'][:10]plt.figure(figsize=(15, 6))plt.title('點(diǎn)贊數(shù) TOP10 的文章',fontsize=18)plt.xlabel('數(shù)量',fontsize=18)plt.ylabel('標(biāo)題',fontsize=18)var.plot(kind='barh', stacked=True,alpha=0.7, color=['green'])plt.show()



點(diǎn)贊數(shù)TOP10的文章



“中興跳樓程序員妻子:他們就這樣把我老公逼死了”文章點(diǎn)贊數(shù)1542,“我們憤恨于現(xiàn)實(shí),在互聯(lián)網(wǎng)內(nèi)外,公司調(diào)整犧牲員工利益的不公平不道德之事時(shí)有發(fā)生,尤其是在互聯(lián)網(wǎng)公司,裁員更是屢見(jiàn)不鮮,尤以“為什么總說(shuō)程序員是吃青春飯的?”為重。而到了個(gè)人身上,隨著年歲增長(zhǎng),學(xué)習(xí)、精神等的下降,上有老下有小,面對(duì)突然的被辭退,壓力可想而知,但是當(dāng)事情發(fā)生之時(shí),我們還是要盡可能地調(diào)整心態(tài),網(wǎng)上評(píng)論的很多,這種基層主管處于不上不下的尷尬處境,只能考慮降低心理預(yù)期,哪怕是從頭再來(lái)呢。生活固然殘酷,但也不要輕易放棄,畢竟還有自己愛(ài)和愛(ài)自己的人??!”,大家對(duì)此特別贊同!

評(píng)論數(shù)分析:

import pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin.xlsx',encoding= 'utf-8',header=1,names=name,)data = df[['評(píng)論數(shù)']]a = data.sort_values(by=['評(píng)論數(shù)'],ascending=False)one = a[a['評(píng)論數(shù)']>=50].sizetwo = a[(a['評(píng)論數(shù)']>=20) & (a['評(píng)論數(shù)']<50)].sizethree ==""><20)].sizeexplode=[0.3,0,0]fras =="" [one,two,three]plt.figure(figsize="(15," 5))plt.axes(aspect="">



評(píng)論數(shù)分布比例



import pandas as pdimport matplotlib.pyplot as pltimport pandas as pdimport matplotlib.pyplot as pltname=['日期','時(shí)間','標(biāo)題','作者','摘要','創(chuàng)作類型','是否頭條號(hào)','閱讀數(shù)','點(diǎn)贊數(shù)','評(píng)論數(shù)','地址']df = pd.read_excel('weixin1.xlsx',encoding= 'utf-8',header=1,names=name,)df = df[['標(biāo)題','評(píng)論數(shù)']]data = df.sort_values(by=['評(píng)論數(shù)'],ascending=False)data.index = data['標(biāo)題']var = data['評(píng)論數(shù)'][:10]plt.figure(figsize=(15, 5))plt.title('評(píng)論數(shù) TOP10 的文章',fontsize=18)plt.xlabel('數(shù)量',fontsize=18)plt.ylabel('標(biāo)題',fontsize=18)var.plot(kind='barh', stacked=True,alpha=0.7, color=['blue'])plt.show()



評(píng)論數(shù)TOP10的文章



“程序猿的一天就是這么糟心!留言有機(jī)會(huì)獲《程序員》一年”搶福利,“程序員有什么錯(cuò)?憑什么殺我祭天”、“程序員的反思:不要一輩子靠技術(shù)生存”有爭(zhēng)議的話題紛紛發(fā)表自己的看法。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Python的利器Pandas庫(kù):超級(jí)簡(jiǎn)單的數(shù)據(jù)可視化作圖,你知道嗎?
一篇文章帶你搞定Pandas繪圖API
《利用python進(jìn)行數(shù)據(jù)分析》讀書(shū)筆記
我用數(shù)據(jù)告訴你,家長(zhǎng)學(xué)歷對(duì)孩子成績(jī)的影響有多大?
漲姿勢(shì),Python 畫(huà)圖竟然還能這么整
機(jī)器學(xué)習(xí)中的概率論與梳理統(tǒng)計(jì)(Python實(shí)現(xiàn)數(shù)學(xué)期望、方差等)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服