Saturday, December 29, 2007
Cows, part 2
In Grade 9, I wrote a program to download comics and newspapers from the web[1] and display them in a whiz-bang DHTML page (that's right, back in my day we called it DHTML, you young whippersnappers, none of this new-age AJAX crap.)
Anyway, to drive this, I realized I could write a bunch of painstaking code to generate the URLs to download the images, or I could write some sort of text-based configuration file that would drive the program.
That worked well for simple cases. Over time, distributors got tricky: the URL for their image had some custom string in it that you could only get if you loaded a specific page on the given day. And you had to have a specific Referer, too! This required a complex pattern matching system. I realized I could write a bunch of painstaking code to match the patterns I needed... or I could look into this thing called regular expressions that I had kept seeing people use on the MOO.
As always, I didn't have a deep understanding of what they were, but seeing what they could do pretty much blew my 14-year-old mind away.
And thus, I committed my first act of (unintentional!) intellectual property theft by including the regexpr package from the LambdaMOO server into my program wholesale. "Attribution? What's that?" Consider this a mea culpa and a fix after the fact.
[1] I now understand how older folks feel when they say "it was the 70s," as if the date somehow excuses their pastel leisure suits. It was the 90s: back then, if you were on the web and didn't have enough popups and banner ads to induce seizures in rates competitive with modern Japanese anime, you were a nobody.
Anyway, to drive this, I realized I could write a bunch of painstaking code to generate the URLs to download the images, or I could write some sort of text-based configuration file that would drive the program.
That worked well for simple cases. Over time, distributors got tricky: the URL for their image had some custom string in it that you could only get if you loaded a specific page on the given day. And you had to have a specific Referer, too! This required a complex pattern matching system. I realized I could write a bunch of painstaking code to match the patterns I needed... or I could look into this thing called regular expressions that I had kept seeing people use on the MOO.
As always, I didn't have a deep understanding of what they were, but seeing what they could do pretty much blew my 14-year-old mind away.
And thus, I committed my first act of (unintentional!) intellectual property theft by including the regexpr package from the LambdaMOO server into my program wholesale. "Attribution? What's that?" Consider this a mea culpa and a fix after the fact.
[1] I now understand how older folks feel when they say "it was the 70s," as if the date somehow excuses their pastel leisure suits. It was the 90s: back then, if you were on the web and didn't have enough popups and banner ads to induce seizures in rates competitive with modern Japanese anime, you were a nobody.
Labels: bsd, comics, intellectual property, moo, regex, theft