You are here

Create your own custom daily Get Satisfaction email report with emailReport.rb

Submitted by Roland on Mon, 2010-08-02 23:42

UPDATE November 2011:

The code has been dramatically re-factored so i deleted it from the gist. Please use the revised code at:
https://github.com/rtanglao/momogs/blob/master/emailReport-m.rb

For my technical support lead job at Mozilla Messaging, I continue to try to find the best way to sort and sift and help out folks who need support and identify the hot issues. We currently use Get Satisfaction for Thunderbird support and I subscribe via email to everything but it's really difficult to read through the over 200 emails a day that Get Satisfaction sends

So I developed over the last 9 months a series of Ruby scripts to see the most active support topics (getactive.rb),  the contributors who are actually being marked by the community of users as solving a support topic (getcontributors.rb), who's doing the most replies (gethappykludged.rb) and pick out some random support topics (getrandom.rb)

Up until last week I have been using these scripts on a manual basis but not as consistently as I would like since it's pain to run all four manually.

To make a single email report that ties together everything in one nice summary, last week I finally took 3 hours and wrote emailReport.rb (code after the jump). It's crude but it works and is a useful report that I run every day now for the previous day (e.g. on Monday morning, I run it for Sunday and Saturday). It runs all the above mentioned scripts and then emails a summary email:

Here's an example of how you invoke it:

(for August 2, 2010)

./emailReport.rb 2010 8 2 2010 8 2 2>emailreport.20100802.20100802.stderr 1>emailreport.2010082002.20100802.stdout

And here's a sample email:

From: xxxx@gmail.com
To: yyyy@zzzzzo.com
subject: MoMo Support Report FROM: 2010.8.2 TO: 2010.8.2
Date: Mon, 02 Aug 2010 23:31:16 -0700
Get Satisfaction Top 5 active:
5,http://getsatisfaction.com/mozilla_messaging/topics/how_do_i_export_folders_as_mbox_files_thanks_chris
5,http://getsatisfaction.com/mozilla_messaging/topics/migration_of_thunderbird_data_from_old_to_new_computer
4,http://getsatisfaction.com/mozilla_messaging/topics/delivering_mail_98_thunderbird_problem
4,http://getsatisfaction.com/mozilla_messaging/topics/from_thunderbird_to_outlook_how
4,http://getsatisfaction.com/mozilla_messaging/topics/cannot_start_thunderbird_already_runnning

Get Satisfaction Contributors:


Top 10 Get Satisfaction Repliers:
2, cam_1319937
3, simonpaquet
3, ankitgupta1980
3, davro
3, pat_drummond
3, kent_james
4, bhuvnesh_thakar
5, wayne_mery
9, archaeopteryx
30, michael_a_pasek


5 Random Get Satisfaction Topics:
http://getsatisfaction.com/mozilla_messaging/topics/crashing_after_start_up
http://getsatisfaction.com/mozilla_messaging/topics/problems_editing_an_email_to_be_forwarded
http://getsatisfaction.com/mozilla_messaging/topics/dmg_file_whats_this
http://getsatisfaction.com/mozilla_messaging/topics/want_to_use_thunderbird_for_mass_mailing
http://getsatisfaction.com/mozilla_messaging/topics/pasting_images_takes_minutes

What I did well

  • It works and when it doesn't I can check stderr for diagnostics and usually quickly figure out what went wrong (Get Satisfaction has a known bug on topics that have URLS that begin with numbers and also JSON can't cope when folks paste binary data into support topics; fortunately both cases are rare -:-) !)

What could be improved

  • The JSON API is called on the same data four times, once for each script (i.e. I don't store any of the GS data) so it takes 5-10 minutes to run emailReport.rb!
  • It would be more efficient to just read the data into a database, e.g. couchdb and then have the four scripts read from the database
  • Ruby is not an excellent choice for Windows users; would be better to write this in JavaScript and then anybody (i.e. other support contributors not just folks on Mac OS X or Linux) could use it
  • Badly need to way to extract the GS conversations I am involved in and highlight the top 5
  • Although a separate can of worms :-), I would love to have a really great search engine that works on the GS support data; unfortunately the GS management view search doesn't work so well.

Help Wanted

I'd love some help :-) (what's in it for you! Open Source Whuffie, fame and adventure :-) !!!)   in the following areas:

  • Convert to JavaScript and to a web app so all can use it :-) !
  • Put the GS support data into a JSON friendly database like CouchDB

 

The Code

The code has been dramatically re-factored so i deleted it from the gist. Please use the revised code at:
https://github.com/rtanglao/momogs/blob/master/emailReport-m.rb

 

Comments

Before making a firm decision on a plan that looks attractive consult with a licensed agent about the possibilities that might happen after you submit an application to the insurer. In this article I will explain the possible scenarios that can happen once you apply. www.broadhealth.org

The term "health insurance" is commonly used in the United States to describe any program that helps pay for medical expenses, whether through privately purchased insurance, social insurance or a non-insurance social welfare program funded by the government. www.coimbrahealth.org

Researchers from the Medical University of South Carolina in Charleston analyzed 5,021 participants in the National Health and Nutrition examination Survey 1999-2000 (NHANES 99-00), which was conducted by the National Center for Health Statistics to collect information concerning the health and diet of American men and women. www.crphealth.org

Many hospitals, medical centers and pediatricians have developed programs to help you keep on top of such things as your child's health and development. They are typically brought to you in an easy to follow fact-tip sheet that you can read and keep on hand for future reference. www.healthynchospitals.org

Looking to make a career change into a fun and exciting industry? Do you find yourself obsessive about your favorite sport? If so, then breaking into the sports industry just might be what you are looking for. www.sportindustryjobs.org

Football (or soccer as the 'non-Brits' refer to it as) is the most popular sport in the World. Millions of people play, at various levels, every single day. Most people play for fun, others professionally, however the aim of the game is almost always the same - WIN! www.betterfootball.org

Traveling with kids can be complicated and frustrating at times. When your kids are tired and cranky it can be hard on everyone, especially if you are in a confined space such as a car or plane. www.traveltohelp.org

Add new comment