Wednesday, June 06, 2012

I finally hooked up my Wizard Scorecard app to update the Wizard Stats site automatically.  Here's how I did it:

  • Changed the Wizard Scorecard app so there's an option to output a .json file attached to an email
  • (The user fills in the To: field (it's a subdomain of ericdsouza.com) and sends the email)
  • Configured the MX records for the subdomain so the mail goes to my Amazon EC2 instance
  • Configured Postfix to pipe emails for the virtual email address to a php script
  • Added a php script that reads the .json file and updates the Wizard stats database
Lots of help from Google and other people who posted tutorials on the various steps.

I used email to transfer the file (rather than say a direct connection from the app to the database) because the app is public, and the stats site is for personal use. Other users of the app can output a .json file and use it for their own stats.  Although, I'm expecting to get requests to output as a .csv because I suspect most people will want to dump it into Excel.

Making sure the whole thing was secure took up more time than actually making it work.  I won't go into the details cause that will make it less secure, but it should be good enough.  

...

My ankle (technically, my talus) is feeling better every day.  On Sunday I was running at about 90%, and cutting / defending at about 60%.  I had physio yesterday and Karen said I could go further.  I'll see how it feels today.  Luckily we just had a downpour this afternoon, so if it also rained up at the school we play at today, the field should be soft.  A couple weeks ago we played on a such a dry field it was like running on pavement with cleats.

I should get ready for Ultimate. 

No comments:

Post a Comment