Archive for the ‘Comp Media for the Web’ Category

« Older Entries |

ICM Web Final: Food Logging site!

Wednesday, December 16th, 2009

Nutritio.us was created out of laziness. I went to a nutritionist a few weeks back and she suggested I write down what I ate every single day, in order to find out how I interact with my food. I know that I’m bad at small daily tasks, but I’m much better with reminders. I decided to create a website that would do it for me. After mentioning it to multiple people, I learned that other people would love to use the site as well. So, I started to create an entire login system. After logging in you could enter the daily report or check out the stastics of your meals, ie-how often you eat at various restaurants, figure out your caloric intake. This would involve PHP & SQL. Meanwhile, a cron job would run, sending you e-mails that you should login to your site and write down your daily meals.
(more…)

Posted in Comp Media for the Web | 1 Comment »

Midterm! – Wear Where. An iPhone app.

Saturday, October 31st, 2009

Front page

Front page

So, for my midterm, I wanted to create an agitprop website designed for a teenage demographic.  It would be called “Wear Where?” and it would let them know if their clothes were made in sweatshops or not.

I was terrified of the complexity, but I was committed to making it happen.  My fears were seriously unfounded.  Due the popularity of the iPhone, there are a ton of tutorials.  The one that matched my needs the most was from nettuts.com.  I finished the tutorial and now it was time to implement my code.  I have grand plans to let Wear Where? to be a native app with the capability to do barcode recognition, but for now, the easiest implementation is a drop down menu that correlates with either a PHP script for a MySQL database.  After discussing it with Corey the resident, the best way to organize it is with multi-sub-folders and then correlating id tags with a php script that changes the image and body text source with the correlating brand names.

When the user chooses the Gap for their brand name, the results page takes Gap with an id tag of ‘gap’ and throws it into my images and content lines of code, <? echo ‘<img src=”brands/’ . $brand . ‘/img1.jpg” alt=”logo”>’; ?>.  I had to be careful not to use double quotes within single quotes.  I also had issues with calling the $brand variable within the image source code, I had to take on the whole img tag to get it to work.  Not sure why, but it was an easy enough fix.  For the content, I wanted either a happy or sad mascot icon, but I ran out of time and just hardcoded the image in.

I spent some (re: too much) time on the logo/mascot, the happy wire hanger, and getting the background to work.  I was having issues the jQuery images aligning to the right, thus forcing my user to scroll to the right and ruining the vertical flow, so I made the background a repeatable image, which was fun cuz I’ve never used the offset tool(ultimately I just created vertical lines instead of diagonal, even though it’s not as cool.  Also had to kill my gradient.)  I also had issues with getting the background to stay constant when the user scrolled down, but again, it was a time issue.

In future versions, I hope to combine with a non-corrupt labor organization or some other NGO, get a thorough listing of sweatshop conditions, pay rates, etc and create a native app that allows for barcode recognition so it can be actually used in stores, in addition to a contact form to get further information or to submit new brands to look for.  But, this being my first semi-big project, we’ll see how it goes.
(more…)

Posted in Comp Media for the Web | No Comments »

ICM Week 6 – Using js to control Physical Devices

Saturday, October 31st, 2009

The Challenge: Use the web to control a physical device or vice versa.  I decided to combine the homework pieces of the serial lab and video objects to ultimately to control the volume of a Quicktime video with a potentiometer.

I struggled with the homework considerably.  Quicktime video have a limited number of video controls, but I was sure that there would be audio levels.  Quicktime itself provides a series of control options on their websites, plus I was able to find two different ways of controlling the audio.  One used javascript and the other used rewriting the QT in javascript as opposed to an object embed.  Javascript was already controlling the play, pause function in the demo, so I figured I could piggyback the volume control into the timerran code and  finally came up with this:

document.bushfinger.SetVolume(inByte);

The real issue was “bushfinger.”  That is the object id.  The issue is the code being used for the video also includes a jpg as it’s intro image.  I was unsure if the id tag on that correlates to just the jpg or the entire object and thusly assumed you needed to give the video it’s own id tag.  Course, I couldn’t find an id tag, but I could find a videoname tag.  Someone mentioned that videoname was the same thing as id.  They were wrong, but understandably.  Also, understandably, it didn’t work with the videoname reference in place of the id.  Here is the finished page.  It won’t really work for anyone who does not have the Arduino, the Arduino code and a potentiometer setup.  Luckily, I have a youtube video that will do the work so you don’t have to.  Cuz I’m a nice guy.

http://davidphillips.us/icmweb/w6-jsstearns.html

This video isn’t the best at proving the concept, but the talking that you hear is the video and then it diminishes with the turn of the potentiometer. Which is awesome.

Posted in Comp Media for the Web | No Comments »

ICM Web Week 5: PHP Strings

Sunday, October 11th, 2009

Heya there team,

So, I am unsure how to call up the last part of an array that I’ve placed in a text file.

The goal is to have the end-user input their zip code and then tell them what the what the temperature is going to be in their city.

I’ve got all the pages in order, per se.

http://davidphillips.us/icmweb/weather.html

which gets processed here:
http://davidphillips.us/icmweb/process_form.php

which goes into this text file:
http://davidphillips.us/icmweb/zipcode_data.txt

and can be seen here:
http://davidphillips.us/icmweb/display_comments.php

How can I get the last zip code to plug into this page:
http://davidphillips.us/icmweb/w5-php.php

Here’s the code:

<?

function myGrabs($stringStart) {
$zipCode = 10010;
$weather_source = “http://weather.yahooapis.com/forecastrss?p=” . $zipCode;
$weather_data = file_get_contents($weather_source);

//        $stringStart = “temp=\”";
$stringEnd = “\”";

$startPos = strpos($weather_data,$stringStart);
$startPos += strlen($stringStart);
$endPos = strpos($weather_data,$stringEnd,$startPos);
$tempString = substr($weather_data,$startPos,$endPos-$startPos);
return($tempString);            //this allows the future calls of the function to nab the result of the function.
}

$myTemp = myGrabs(“temp=\”");
echo(“The weather is currently ” . $myTemp);
$myCity = myGrabs(“city=\”");
echo(“in the lovely and underappreciated city of ” . $myCity . “.”);
?>

So, to sum up, I want to get the last placed array from the text file or from the first page, and plug it into the final page as the $zipCode.

All the pages are pretty in line with the notes code.
Preferrably, this could all be done in 2 steps and not 5 or whatever, but that’s beside the point.

I hope you are all having luck with your pages!

Sincerely,

David

Posted in Comp Media for the Web | No Comments »

ICM Web – Week 3 Homework

Tuesday, September 29th, 2009

Hana and I started working on a fortune teller for the web last week and I finally got mine up and running.

THE ITP FORTUNE TELLER!!

Any critiques or comments are appreciated.

Thanks again,

David

Tags: , , , , ,
Posted in Comp Media for the Web | 1 Comment »

« Older Entries |