Call for Submissions: Mom’s Tattoo
My good friend Sarahdipity pointed out to me on Thursday that my mom, traditionalist that she is, might not know what kind of tattoo to get with her coupon. She suggested that I turn to my audience for suggestions, and so I shall do. I suspect that there are fewer than 5 people reading this blog, myself included, but if you have any suggestions, please do post them in the comments.
Thanks.
Yesterday, I found this feed while searching for a way to be automatically notified when a new issue of a comic book that I like is available.
Unfortunately, it didn’t quite get the job done. For one, it presents all comics published on the same day as a single post. Also, as a result, it is very challenging to filter out the comics I don’t care about.
I wrote some code to parse the feed to give me an rss feed with posts for each comic, rather than one post for all comics:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | #!/usr/bin/perl use XML::Simple; use XML::Writer; use Time::Local; use Date::Format; use Getopt::Long; use strict; my $generator = "ComicsFeedParser.pl @ARGV"; my $publisherfilter; my $comicfilter; my $pricefilter; my $filter; my $feedtitle = 'Published Comic Books'; my $silent = 0; GetOptions( 'publisher=s' => \$publisherfilter, 'comic=s' => \$comicfilter, 'price=f' => \$pricefilter, 'filter=s' => \$filter, 'title=s' => \$feedtitle, 'silent!' => \$silent, ); my $curlurl = 'http://feedproxy.google.com/comiclistfeed'; my $curloptions = $silent ? '--silent' : undef; my $data = `curl $curlurl $curloptions`; my $xs1 = XML::Simple->new(); my $doc = $xs1->XMLin($data); my $pagelink = $doc->{channel}->{link}; my $writer = XML::Writer->new(); $writer->xmlDecl(); $writer->startTag('rss', 'version' => '2.0'); $writer->startTag('channel'); $writer->startTag('title'); $writer->characters($feedtitle); $writer->endTag('title'); $writer->startTag('link'); $writer->characters($pagelink); $writer->endTag('link'); $writer->startTag('description'); $writer->characters('Newly Published Comic Books'); $writer->endTag('description'); $writer->startTag('pubDate'); my @now = gmtime; $writer->characters(strftime('%a, %d %b %Y %H:%M:%S %Z', @now, 'GMT')); $writer->endTag('pubDate'); $writer->startTag('generator'); $writer->characters($generator); $writer->endTag('generator'); foreach my $item (@{$doc->{channel}->{item}}) { my @gmt; if ($item->{title} =~ /(\d\d)\/(\d\d)\/(\d\d\d\d)/) { @gmt = gmtime(timelocal(0,0,0,$2,$1-1,$3-1900)); } else { @gmt = gmtime; } my $date = strftime('%a, %d %b %Y %H:%M:%S %Z', @gmt, 'GMT'); my $link = $item->{'feedburner:origLink'}; my @lines = split("\n", $item->{description}); my $publisher; my $publisherlink; foreach my $line (@lines) { $line =~ s/\s+/ /g; my $itemlink; if ($line =~ s/<a href="(.*)">(.*)<\/a>/$2/) { $itemlink = $1; } if ($line =~ /<p><b><u>(.*)<\/u><\/b>/) { $publisher = $1 unless ($1 eq 'PUBLISHER'); $publisherlink = $itemlink; } elsif (defined $publisher) { my $comic; if ($line =~ /(.*)<br \/>/) { $comic = $1; } elsif ($line =~ /(.*)<\/p>/) { $comic = $1; } if ($comic) { my $title; my $price; if ($comic =~ /(.*), (.*)$/) { $title = $1; $price = $2; } else { $title = $comic; } my $comiclink = $itemlink; my $filterresults = 1; if ($filter) { $filterresults = eval $filter; if ($@) { warn $@; $filterresults = 1; } } if ((!$publisherfilter || $publisher =~ /$publisherfilter/) && (!$comicfilter || $title =~ /$comicfilter/) && (!$pricefilter || $price <= $pricefilter) && $filterresults) { $writer->startTag('item'); $writer->startTag('title'); $writer->characters("$publisher: $title"); $writer->endTag('title'); $writer->startTag('link'); $writer->characters($comiclink || $publisherlink || $link || $pagelink); $writer->endTag('link'); $writer->startTag('description'); $writer->characters("$publisher: $title, $price"); $writer->endTag('description'); $writer->startTag('pubDate'); $writer->characters($date); $writer->endTag('pubDate'); $writer->endTag('item'); } } if ($line =~ /(.*)<\/p>/) { $publisher = undef; $publisherlink = undef; } } } } $writer->endTag('channel'); $writer->endTag('rss'); $writer->end(); |
As you can see, there are a variety of filter flags that allow me to create customized feeds.
For example:
- ComicsFeedParser.pl −−comic “Buffy.*Season Eight” −−title “Buffy Season 8″
- ComicsFeedParser.pl −−publisher MARVEL −−title Marvel
- ComicsFeedParser.pl −−comic Powers −−title Powers
- ComicsFeedParser.pl −−comic Fables −−title Fables
Obviously, the generic filter flag behavior would have to be changed before I could make this available to the public (−−filter “fork while true;”, for example, could be a problem). But it suits my purposes for now.
I have discovered the greatest bit of javascript ever created, in the history of javascript:
.
I have to agree with Clay Shirky when he says:
“The internet is done, we can all go home and congratulate ourselves on a job well done.”
Go forth and cornify, dear reader. I highly recommend adding the javascript link as a bookmarklet; it makes the whole internet better.
Who is this product for, exactly?
In my life, I’ve met two types of men:
- Circumcised men, who can’t imagine why anyone would ever want a foreskin, and
- Uncircumcised men, who can’t imagine why anyone would ever want to be circumcised .
So who is this product for exactly?
I guess there are a lot of foreskin restoration sites out there.
And when you really think about it, who wants to live with mangled, incomplete, unnatural genitals?
I’m thinking about getting circumsised just so that I have a need for this product, tho. Or perhaps there’s some way in which I could use a spare?
[via boingboing]
… is gonna rock!
- The Mall of America
- Cereal Adventure
- Funny Accents
Who could ask for anything more!?
Also, I’ll be seeing my amazing girlfriend for the first time in over a month. I’ll be back on Sunday. Probably. Minnesota is gonna rock!
The Princess and the Magic Ticket
My girlfriend, Cherry, works as a college recruiter. The college she works for sent her on a whirlwind trip around Asia to entice young high schoolers to come join the college. She’s gone for all of September, which pretty much sucks for me, but there are some upsides. For one, I’ve gotten to see many foreign cities through Skype and her hotel windows. Another great benefit is that she has some pretty good stories to tell. The following is one of them, though I’ve edited it some in my pursuit of good story-telling:
It’s that time again. Taiwan was so good to me, but as most things in life, my visit to that wonderful city had to come to an end. But before I fly off to my next destination, I must, oh yes I must, tell you a story, of a beautiful young princess in a foreign city, and the adventure she found herself in on her first day….
There was a Friday, early in September, when a foreigner who wasn’t really a foreigner, entered the hollowed corridors of a train station that wasn’t really a train station. In a hurried pace, she dashed through the doors, searching frantically for a machination that would give her a famed magic ticket to board what was known only to her as the Bullet Train. She’s never ridden such a wondrous vehicle, but oh was she excited.
Scampering about the station that wasn’t really a station, she finally spotted a bright, glowing machine. It was occupied by the most unlikely fellow–a young fairy child, no more than ten, eagerly pressing all the buttons as if it was his own personal arcade. Politely, the young princess interrupted his fun. The lad, recognizing that he was in the presence of a great royal, stepped to the side, but he could not leave her gracious presence entirely; instead hovering ever so gently above her shoulder to see what the young princess would do and where she was headed on the wondrous Bullet Train. The lovely fairy tried to make sense of the fantastic machine for the young lady in this foreign city, but there was nothing to be done. The much sought after magic ticket was not easily procured.
As the fairy flitted about, the princess gaze was temporarily drawn from the otherwise entirely fascinating machine, and, in that brief moment, the princess spotted a lighted booth. With an eager face, she hurried over to the counter, glancing at the bejeweled clock on the pristine wall. It was there that she met a warlock of immense power. Biting her lip, the foreigner who wasn’t a foreigner frantically tried to communicate the emergency she found herself in to this magical man, but despite his deep knowledge of the dark arts, he too could not produce the magic ticket. He instructed her to descend to the mysterious dungeon in her quest for the ticket she so desired.
Bidding the warlock goodspeed, and warning him to use his power only for good, the princess hurried off again, giving the fairy child a smile and wave as she passed him by. To her great surprise, she was no longer alone in her journey, as she joined the other hurried myriad of others descending the stairs below.
Finally, just as she set foot on the last step, a brighter, glowy-er, more fantastic machine appeared in front of her, as if by fate. And in a language she recognized, she followed the instructions until the sought after magical ticket was at long last procured.
Oh but wait, for the story doesn’t end there. The awestruck young princess rode the wondrous Bullet Train twice more until she was done with her adventuring and was ready for one more ride back to the city. Feeling quite proud of herself for surviving a day full of the Great Unknown, she paid the chariot driver. But alas, she was running low on gold! Looking at her watch with worry, she passed through the sliding doors, and came upon an AATM (Automated Alchemy and Transmogrophy Machine) machine. She was saved!
Or so she thought.
The machine would not allow her to get the much needed gold she so desperately desired. And royal seal after royal seal, she tried to convince the horrid machine that she was in fact the princess of the land that wasn’t a land, but to no avail! Visions of being stranded with no way of getting back to the city flashed before the young princess’ most beautiful eyes. And even the glowing machines that had produced her first magic ticket betrayed her, spitting out her royal seal in spiteful denial. Finally, the young princess spotted an eager face in a booth, similar to the eager warlock she had first met earlier in the day. And her savior was found! With a touch of her magical hands, the young princess’ seal finally worked!
Safe and sound once more in her castle, the young princess lay down in her bed of the finest silks, and began her descent into the dream world, where once again she could live her fantasy life as a college recruiter.
As you are no doubt aware, my birthday approaches.
If you’re scrambling for a last minute gift, why not get me the TantaChair. I promise to put it to good use.
It may sound like a joke, but I really do want this thing. Don’t those guys look like they are having fun? I was tempted to add it to my wishlist, but then I remembered that my mom and grandparents use that list to shop for me. I think I’ve had enough discussions about weird sex stuff on the internets with my grandpa already…
[via boinboing gadgets]
Mike and I also invented a religion at said party. The religion is called Carrotanity, and we have one fundamental belief:
- Carrots are the ultimate snack.
If you accept carrots as the ultimate snack, your life will improve, as you can call your self a Carrotanist.
Although Because I myself find religious proselytizing distasteful, Mike and I embarked on a mission to convert the entire party to our religion.
We had surprisingly little luck converting people at the party to Carrotanity, and there was one girl that thought we were using this as a pick-up line. I guess cult leaders do get laid a lot, but I never thought spreading a silly religion about carrots would work as PUA…
Mike’s suggestion is that we choose a religion that requires less commitment next time. He’s right, claiming something as the ultimate snack leaves little wiggle room. Next time, I’ll try to convert people to This Party is Not Terriblism. Our one and only belief:
- I’m not having a terrible time at this party.
