Created
December 23, 2013 13:43
-
-
Save mikeda/8097331 to your computer and use it in GitHub Desktop.
はてなダイアリーの年ごとのブログ投稿数を集計する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://d.hatena.ne.jp/<USERNAME>/archiveにアクセスて50日ずつのページ数がいくつあるか確認しておく・・・ | |
USERNAME=mikeda | |
PAGES=5 | |
for((i=0;$i<$((50*PAGES));i+=50));do curl -g "http://d.hatena.ne.jp/${USERNAME}/archive?of=${i}" > archive_${i}.html;done | |
cat archive_*.html | grep "archive archive-section" | perl -lne 'm|'${USERNAME}'/(\d{4})\d{4}/| or next;print $1' | sort | uniq -c | |
# 44 2008 | |
# 88 2009 | |
# 26 2010 | |
# 40 2011 | |
# 35 2012 | |
# 9 2013 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment