Flickr: hacking comments and monitoring profile views

I love Flickr. Seriously.

But one thing puzzles me: why do they allow off-site images in comments? It makes no sense to allow people to post comments on pictures with stupid animated gifs. It only makes sense to allow commenters to include other Flickr pictures as part of the discussion. Well, since they allow it, I decided to play with the concept a bit.

I have long used a PHP program to track views of my comments on other websites, most notably on PersonalMBA. My avatar is actually a link to a PHP program running on my site. The program (code below) records some information about the request in a log file, and then gives the JPG file over to the client. They never know that I’ve logged the fact that they requested my avatar. What have I done with this information? Pretty much nothing, except to give me an external view in to the popularity individual pages on the site.

So, I used this PHP program to leave comments on Flickr. But so as to not make things obvious, I have the PHP program send a 1×1 pixel clear GIF. The program then logs every time someone views another persons picture page on Flickr. Again, what have I done with this information? Umm, nothing, yet.

But it brings up another interesting possibility for the “off-site images in comments” thing that Flickr allows. If I can make it link to an off-site image, then I probably can change the image. If I wanted to do something devious, I could post a lot of “Great Shot” comments, including a reference to my off-site image. Initially the image would be a 1×1 clear gif so no one could know. Then, when I feel evil, I could change it to something, um, evil. Yes, my account would be banned. Yes, the comments would be deleted, but not before my “evil” image was viewed thousands of times. And then I could do it again with a new account. Why would I do this? Um, again, I’m not sure.

Profile monitoring

So after all that evil making, I’ve figured a more innocuous use for my PHP program–logging how many times people view my profile in Flickr. I find it odd that Flickr doesn’t tell me this by default–they tell me the number of times my images and sets are viewed. Why not my profile?

So, the concept is the same. I include an image in my profile thusly:

The code, listed below, logs the request and delivers the image. I now have a way to satisfy my ego for how many times people view my Flickr profile. Yippee.

Here is my PHP code. I adapted it from somewhere, but I don’t remember where. You will need to modify it to specify the log file and the image file.

< ?php //Modify these two to suite your needs $vfile = "flickr.gif"; $filename = 'logfile.log'; function readfile_chunked($filename,$retbytes=true) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $cnt =0; // $handle = fopen($filename, 'rb'); $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); echo $buffer; flush(); if ($retbytes) { $cnt += strlen($buffer); } } $status = fclose($handle); if ($retbytes && $status) { return $cnt; // return num. bytes delivered like readfile() does. } return $status; } header("Content-type: image/gif"); readfile_chunked($vfile,false); $somecontent = date('m-d-y H:i:s '). $_SERVER['REMOTE_ADDR']." ". $_SERVER['HTTP_REFERER']. " " . $_SERVER['USER_AGENT']."\n"; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?>

Orton Imagery — My current obsession

My latest obsession is with Orton Imagery, or the Orton effect, or Ortonized photos, whatever you want to call it. I found a great introduction to the technique here.

Most of the explanations of the technique cover Photoshop, or Adobe elements, neither of which I own. I went looking for GIMP specific explanations, and found a decent one.

Before I get too far, you really should see some of the excellent work in the Orton Flickr pool. In a nutshell, the Orton effect adds an incredible dreaminess to a photo, immediately elevating it from snapshot to artwork.

So, my point here is to write a click-by-click tutorial for doing this in The GIMP, because, although the one above it decent, it left a lot to be desired for my (previous) level of GIMP experience. This applies to version 2.2.11.

  1. Open your image in The GIMP. (OK, I hope you can figure that much out).
  2. On the Dialogs menu, choose Layers.
  3. Right click on the Background layer and choose duplicate.
  4. Right click on the Background Copy layer and choose duplicate. You should now have three layers: Background, Backgroupd Copy, and Background Copy #1.
  5. Set the Mode for Backgroup Copy to Screen. If you click the eye in front of Background Copy #1, you’ll see that your image has an over exposed look to it. Be sure to click on the spot where the eye was to make the top layer visible again.
  6. Right click on the Background Copy layer again, and choose Merge Down. You will now have just two layers: Background and Background Copy #1.
  7. Select Background Copy #1 in the layers dialog.
  8. On the image’s Filters menu, point to Blur, and choose Gaussian Blur…
  9. Set the Blur Radius for Horizontal and Vertical to somewhere in the 20-30 range. This is something you can play with to see how you like it, and will depend on the resolution of your picture. Also, set the Blur method to RLE (OK, I don’t know why. I can’t tell the difference between RLE and IIR. Just DO IT!).
  10. Back on the Layers dialog, set Background Copy #1 to Multiply mode, and then play with the opacity to see what you like. Then change the mode to Dodge, and play, then Burn, then back to Multiply, then Soft Light, then Multiply. Anyway, you get the idea. This is where your personal preference will come in. I set mine to Multiply with an 88.6% opacity.
  11. Save your image as a JPG to post it on-line, or as a GIMP xcf if you want to keep the layers separate and still have the opportunity to play with it.

Trip to King’s Island

We went to King’s Island this weekend. Here’s what we paid, and some lessons learned.

  • $47 for 4 tickets and 2 parking passes (one for Friday and one for Saturday). This dicounted rate was provided by my employer. Normally this would have cost (according to their website) $140 + $20 parking.
  • 115$ for the hotel room Friday night (including taxes) at the Microtel next to The Beach.
  • $30 for dinner Friday night at Larosas at KI.
  • $35 for breakfast Saturday morning at Perkins on Kings Island Blvd.
  • Free lunch Saturday (provided by my employer).
  • $6 for locker rental in Boomerang Bay
  • $40 for dinner at Wings in KI.
  • $20 for souvenirs
  • $15 for Gaeters Ice Cream.

So, thanks to my employer, we spent 15.5 hours at KI for just over $300, including a hotel room. It would have been longer, but Nathan felt ill Friday night so we went to the hotel room 2 hours earlier than anticipated. Fortunately, he was much better the next day.


Although La Rosas and Wings were a bit on the expensive side relative to other possibilities on the park grounds, we got a good bit of food for the money. Therefore we didn’t need any mid-meal snacks. So even if we had scrimped and saved $10, it probably would have been consumed in snacks. We also might have saved money by eating at McDonalds rather than Perkins, but I think we would have spent that savings on a morning snack or something. As it was, we didn’t feel hungry until 1:30PM, just in time to catch the free lunch.

Lessons Learned

We spent a lot of time walking to and from Boomerang Bay, which unfortunately has more limited hours than the rest of the park, making it difficult to spend “half” of the day there. When we got there at 6PM Friday, we learned they would close in just one hour. Bummer. And after I paid for the locker at 11AM Saturday, I learned I would have to clean it out by 7PM, rather than leaving our stuff in it until we left at 10PM.

Almost everything on the list of expenses above would have taken credit. The only exceptions are locker rental and souvenirs (they were the vendors pushing a card in the middle of the park). As such, I had way more cash than was really neccessary, and therefore made me uncomfortable worrying about my wallet getting stollen. Next time, no more than $50 in cash.

Radio or cell phones: a couple of times Anne and I got separated for 30 minutes or more as we tried to figure out where/when we were supposed to meet. The ideal solution here is waterproof two way radios. Had we thought to get her cell phone from the car, that would have been almost as good.

Water rides look fun, but getting soaked on a 90% humidity day just makes it worse. It is no fun walking around drenched. We ended up changing into our previous day’s clothes so that we weren’t miserable.

The old-school adult rides had much shorter lines than the kid’s rides and the new rides. The Beast and the Vortex had 30 minute lines. We walked right on the Racers. In contrast, Italian Job Stunt Track had a 75 minute wait. The kids rides in Nickelodeon universe (at least in the morning) were incredibly packed. My guess is that they probably weren’t so busy after about 4PM.

The kid pass through works pretty well. Nathan didn’t want to ride the Beast. So Anne and Emily went first. I got in line with Nathan and let people pass until Anne’s coaster came back. I climbed in, and Nathan climbed through. He then waited with Anne and Emily while I got to ride.
All in all, it was a good experience.

Why I love this place

One of my co-workers gave me a pack of stickers called “I {heart} the Office” with such nuggets as “I {heart} Win-Win” and “I {heart} marker smell” and “I {heart} an empty in-box”. So that got me thinking about what I {heart} about where I work (tongue firmly in cheek):

  • I {heart} Hallway nonversations
  • I {heart} stall calls
  • I {heart} coffeepot friends
  • I {heart} off-topic replies
  • I {heart} artificial enthusiasm
  • I {heart} 8 o’clock
  • I {heart} …

I’m sure there will be more…