Blog data statistics

Source: Internet
Author: User

Today's Whimsy are wondering whether there is any relationship between the reading times and the release time of so many articles in the blog Park.

Therefore, I wrote a simple JS script to collect statistics on the publishing time, reading times, recommendation times, and comments of 200 articles on the 4000 page of the blog homepage.

(I don't know if it has brought a burden to the server. Sorry, it's administrator's shoes)

The following figure shows the data generated by JS in Excel.

 

Number of articles-Distribution of readings

The horizontal axis of this figure is the number of reading times of the article. The step is 100. The vertical axis is the number of articles computed. It can be seen that most articles have been read for 300 to times ~ In the range of 1600.

I have posted four articles before, and read 100 +, 400 +, 500 +, and 2400 +, respectively ~~

 

Then I found that the number of reading articles in several articles is exactly the same as a bug. The number of reading articles may be + or +. Well, this is a small probability event. So I deleted all those reading more than 5400 of the sample data (83 in total) and created the following two images.

Times of reading-distribution chart of release time

It's a bit interesting, huh, huh. Articles published between AM and am usually have very few reads. The number of articles published between and is also small. Maybe everyone eats at 7 o'clock.

The articles published between nine o'clock A.M. and are most likely to be read. There is also a high possibility of reading articles published between 11 and 12 o'clock (does it mean programmers are all night owls)

 

Comments, recommendations-release time distribution chart

The figure is similar to the one shown above, and the data of the two images is basically positively correlated.

 

In conclusion, I will try again later at nine o'clock A.M. to, and I will try to make a smile ....

 

================================================================== ==================

Okay, I posted the code too. Alas, it's ugly. Don't laugh.

1 var pagenum = 1; 2 function enumpagenum () {3 if (pagenum> 200) return; // a total of 200 pages 4 $ ('. P _ '+ pagenum ). eq (0 ). click (); // jump to this page 5 console. log ('change to page' + pagenum); 6 checkstatus (); 7} 8 9 function checkstatus () {10 // wait 200 milliseconds after the jump to check whether the load is complete, the criterion is that the style on the paging control is added with the current class 11 setTimeout (function () {12 if ($ ('. P _ '+ pagenum ). eq (0 ). hasclass ('current') {13 var L = $ ('. post_item '). length; 14 console. log ('get data of page' + pagenum + 'length: '+ l); 15 if (L <20) {checkstatus (); return ;} // I found that sometimes even if the current class is added, but the data is not actually loaded 16 processdata (); 17 18 pagenum ++; 19 enumpagenum (); 20} else {21 console. log ('wait page' + pagenum); 22 checkstatus () 23} 24}, 200); 25} 26 27 var res = []; 28 function processdata () {29 $ ('. post_item '). each (function () {30 var diggnum = $ (this ). find ('. diggnum '). text (); 31 var cmtnum = $ (this ). find ('. article_comment> '). text (). split (') [1]; 32 cmtnum = cmtnum. substring (0, cmtnum. length-1); 33 var viewnum = $ (this ). find ('. article_view> '). text (). split (') [1]; 34 viewnum = viewnum. substring (0, viewnum. length-1); 35 var posttime = $ (this ). find ('. post_item_foot ') [0]. childnodes [2]. nodevalue. split ('yu ') [1]; 36 posttime = posttime. split ('') [1] +'' + posttime. split ('') [2]; 37 var postdate = posttime. split ('') [0]; 38 posttime = posttime. split ('') [1]; 39 40 res. push ({41 PN: pagenum, 42 DN: diggnum, 43 CN: cmtnum, 44 Vn: viewnum, 45 PD: postdate, 46 PT: posttime47}); 48 }); 49} 50 51 enumpagenum (); 52 53 for (VAR I = 0; I <res. length; I ++) {54 console. log (RES [I]. pn + ',' + Res [I]. DN + ',' + Res [I]. CN + ',' + Res [I]. vn + ',' + Res [I]. PD + ',' + Res [I]. pt); 55}

I posted the code. Let's take a look at it. Don't all run and play on your own. After a while, the server in the blog garden will run down, and the Administrator will be angry. Grievance...

 

====================================================================== ==================================

This article, which says "play", goes to the "most comments" on the homepage to save the picture as a souvenir.

To be honest, it seems pretty awesome now. In fact, I have carefully written the previous articles on my blog, and I have personally practiced all the data and processes.

However, apart from the large number of articles I have translated, there are few others who have read this article. This article is even more outrageous and I did not expect to attract so many replies.

Of course, I'm glad to hear from you, but why are there no followers in the previous articles?

I think there are many shortcomings in my own technologies or expressions. We still need to work hard to improve.

 

====================================================================== ======================================

Based on liumingyu's suggestion, add three images.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.