I am doing a project that involves processing data from my Gmail history.
Specifically, I want to generate a multi-page styled PDF that has a custom page for each of 100 or so people – showing data such as number of e-mails sent in the past year, number of e-mails received in the past year, average word length of e-mail, most used terms in e-mail, date of oldest e-mail sent or received, maybe even average number of exclamation points or expletives per e-mail, etc.
I saw this question, which had a helpful link to IMAP functions in the PHP manual, but can someone help me out with what the architecture and difficulty of such a project would be?
I am envisioning:
- write a php script to run some IMAP functions on my Gmail data and write it to a MySQL database.
- write another script to run a loop of MySQL queries on the database and print to a PDF based on the results
First of all, you need php imap library.
Then, just use this simple step-by-step tutorial:
With code above, you’ve already created connection to Gmail.
Now, if you want to search particular message, use this:
This code will process retrieved messages (you can then process it to MySQL as you please):
Answering your additional question: