1 Scripts to Count Messages from Google
2 ==============================================================
4 Author: Benjamin Mako Hill (mako@atdot.cc)
5 License: GNU General Public License version 3 or any later version
6 Code: http://projects.mako.cc/source/?p=gmail-maildir-counter
8 I wrote this code in order to do the analysis I posted in this blog
11 http://mako.cc/copyrighteous/google-has-most-of-my-email-because-it-has-all-of-yours
13 If you want to send me patches or bugfixes, details on how to do that
16 http://projects.mako.cc/source/
18 1. Parse your mailbox using the count_gmail.py script
19 --------------------------------------------------------------
21 I ran the script like this:
23 $ python count_gmail.py ~/incoming/mail/default > mail_metadata.tsv
25 2. Parse the output using analysis.R
26 --------------------------------------------------------------
28 If have not used R, you will to install R and three libraries I use in
31 First, install R. In Debian and Ubuntu, the package is r-base.
33 You will then need to install three R libraries. The easiest way to do
34 that is from within R. To start R, just invoke it from your shell:
38 Once R is running, you can install the packages by running these three
39 commands from within the R interactive shell:
41 > install.packages("data.table")
42 > install.packages("ggplot2")
43 > install.packages("reshape")
45 Once youv'e done that, you can run the scripts. I run R interactively
46 in Emacs/ESS but you might want to use RStudio if you are not familiar
47 with Emacs. Alternatively, if you also output into mail_metadata.tsv,
50 $ R --no-save < analysis.R
52 It will create the two PDFs files of graphs for you in the local directory.
54 The I converted the PDFs into PNGs with imagemagick's mogrify:
56 $ mogrify -format png *pdf