Archive for February, 2010

For this week, I wanted to try out the email-post-to-blog code, so that I could take advantage of a WordPress blog rather than create all the pages myself.  I installed a WordPress blog on my ITP-NYU server, chose a theme, and made adjustments to the stylesheet and images. Check out my PICTURE VEGAN site (but note that the majority of content still needs to be added).

Before working on the visuals, I of course worked on the integration of the code into the parseMailScript.php file…[I will complete this post soon, just tied up with other coursework at the moment]

I just saw “Food Inc.” last night, which re-energized my ongoing desire to contribute to the growth of the organic, vegan food movement.  I’ve been thinking of what I can do for a midterm project that is realistic to execute within a week and I decided to expand on the MMS photo upload assignment.

Vegan cherry chocolate-chip ice cream at Sacred Chow

Vegan cherry chocolate-chip ice cream at Sacred Chow

I want to create a website repository for photos of vegan dishes from specific restaurants around the city, along with explanations from diners on why they like the dish, how it makes them feel, etc.  Restaurant owners can view these photos/stories and award a chosen diner with a coupon for 10% off their next meal.

The flow would be:

  • diner takes a photo and emails it to a designated email address for that restaurant, noting the dish name in the subject header and the reason for eating it in the message body
  • the photo and information from the email will get inserted into a MySQL database on the server
  • the diner will receive a return email with the URL for viewing their photos and others of that restaurant (email addresses will not be viewable on the website)
  • the owner of the restaurant will review all the photos/stories and choose one for the award either based on quality or a random draw (perhaps this could happen on a monthly or even weekly basis); the owner will send the recipient an email notification
  • the chosen photo/story will featured on the website gallery

Aside from the film, another, more direct inspiration for this idea is the blog of a young woman I know who regularly dines at Pure Food and Wine/One Lucky Duck and blogs about the dishes she eats: DISCOVERING RAW.  I believe her blog has inspired her friends to try raw vegan cuisine and to transition to a healthier lifestyle.  Rather than a blog from one person though, I want this site to be collective in nature.

Eventually I’d like to create a mobile application with a simple form that people can fill out so that the restaurant name can be incorporated into a pull-down menu and so that the MMS emails go to the same email address.  The photos can be sorted by restaurant on the website, rather than on separate pages.

This week we learned about MMS and how to set up a MySQL database to receive photos sent via email (and from a mobile phone) and display them via PHP on a web page.  I followed the instructions on the syllabus page and also set up a separate Gmail account to be the recipient of such emails.  I utilized my NYU-ITP server, as with the SMS assignment.  It was a bit tricky to get the cron file working properly (I didn’t write the correct path at first) but I was able to get it working thanks to information from error messages that I received via email and also via the Terminal.  I also ran into a weird problem after sending photos from my Gmail account via Microsoft Entourage.  All of the information was being input into the MySQL database but the photo wasn’t being inserted.  After talking with Shawn and running the parseMailScript.php in Terminal, we saw that Entourage was changing the meme for the image to something generic – in other words, the attachment wasn’t being recognized as a “.jpg” and thus wasn’t being inserted into the database.  After sending again from Gmail on the web, it worked just fine.

I had a bunch of different ideas for what to do with this photo display but for the purposes of testing and showing to the class, I used some of my favorite astronomy photos.   I titled the webpage “WHAT’S UP?“, as in “what is up in the sky that interests or inspires you”?  This could be built out to serve as a gallery for photos that display interesting phenomena or effects that could in turn inspire graphics for Processing applets or OpenFrameworks applications.

Our assignment for the week was to take our idea for an ITP-oriented SMS application and execute it.  After class, I spoke to Gordie about the waitlist notification idea, and while he liked it, he said he needed to be in contact with people individually because every waitlist rise has to correspond with a class drop and thus he has to find out what each person wants to do given new choices.  Makes sense.

So then I thought I’d go ahead with the class list in relation to the current courses…but I think this idea is better suited to a web page, especially since there isn’t an easy unique ID or code that people can text to get results for individual students or classes, and of course the text message that would be sent back would be truncated due to character limitations so long lists of names or courses wouldn’t make it through.  Even to do a web page would be prohibitive in that I can’t get an official list of student enrollment in classes to work with, so I’d have to solicit this from everyone myself, which would be a pain.

I had other ideas that involved lists of students – for instance, if you text a Zodiac sign like “Libra,” you could find out all the people who have that sign, or you could text “PC” to find out which students have PCs instead of Macs – but once again, this information would have to be gathered from people individually and there would be the same limitation of names being sent out.

For assigments like this, it’s best to keep things simple, so I decided to build off the class example, which queried the Yahoo weather RSS feed with a zip code to return the corresponding temperature via text. I sat with Cindy and David, and together we troubleshooted the PHP code to get the example working with our own databases on the NYU ITP server and with our TextMarks accounts.  The idea I came up with that night was to pull headlines from the RSS feeds of geek-related news sites like Cranky Geeks.  I just had to find unique tags or words (by viewing the source code) around the latest headline text that I wanted and make them the values of the $stringStart and $stringEnd variables.  I also cleaned up the code and folded the function into the “if” statement relating to the input codeword.  I got this to work on my mobile by texting “cranky” to TextMark’s 41411 number, after also texting my account keyword.  I got back the latest headline (and also tested the other returns specified in the “else” sections of the code).  I had planned to expand this idea to include four other RSS feeds from other sites but decided to try something else.

The next day I sat with Matt G, and we came up with the idea to get data from the ITPedia site that would be relevant to ITPers.  Matt focused on the TNO page and I chose the DriveBy one.  Both involved stripping excess code between the start and end strings – we looked up the appropriate function on the PHP reference site, which is strip_tags($text).  It also involved replacing some words in Matt’s case, which meant using the str_replace function. The DriveBy page lists events by date, so I was thinking of creating an automatic way to determine the next DriveBy instead of finding it manually.  I looked at the getdate function in PHP, which returns an associative array, and contemplated calculations that could compare the current date with the dates listed on the DriveBy page.  I started to work on this but ran out of time and also decided that it was uncessarily complicated to execute for this assignment.  Will ITPers use this?  Probably not, since it’s easier to check the wiki than remember the 41411 number, but it does give people another option to remind themselves of the DriveBy topic if they’re out and about, have the 41411 number stored on their mobile phone, and if they don’t have an internet connection or the time to check online.  I plan to finesse it and send it out to the list to test.