One thing that I didn’t really get before working on my thinking-of-you webpage: all web developers write OpenSource code. Once it is on the web, anyone can read it.
Copyrights are fine but is copying someone else’s method of selecting colors of setting up a form or changing font colors for a section instead of a div really protected? I’m not talking wholesale page stealing, just copying snippets.
I didn’t do anything that I didn’t attribute (or learn from HTML and CSS book I mentioned before). But I did read a few random pages, trying to see how they did this or that. That was kinda neat, looking at how pages are put together, now that I speak a little bit of the language. I understand why so many things are hidden in PHP layers: so no one can see a site’s undergarments.
Usually, my code is seen by one or two other people, during code reviews or when it is reused, not by anyone who cares to look. I don’t think I mind but it is a little odd. I mean, what if there was a better way to do it? On the other hand, I’m such a noob at web dev that I’m sure there is. And if you tell me, I’ll be happy to know. So why am I nervous?
Here it is:
That won’t actually blink my LED. While it will let you set your name (and color if you don’t like the one it chooses), it will give you an error when you try to send some love to Christopher. (Hey, if I’m going to be working on this, might as well make it my sweetie.)
The response page is ugly, I’m going to ask Electric Imp about making the response prettier. I don’t care too much about the no-id get-error version but the one with the real key just sends back a page with OK in it sans prettifying.
Note that I met most of my goals: it is one page, settings are hidden after you put your name in, the cookie works (though Firebug can’t find it which is a pain for debugging). I also added my stretch feature of changing the button text on reload. That was easier than I expected and it amuses me.
I updated the Electric Imp code so with the right key in the html, I can change the LED. But I’ve decided to use a PWM LED instead of my fancy I2C LED. That shouldn’t take too long (Electric Imp has RGB LED example code). Then I’ll combine it my USB chargeable LiPo, then put it all in a jar with some hotglue.