Code: Delicious.com + Thumbalizr screenshots + caching

I’m playing with my Delicious Snapcasa code this weekend to see if I can replace Snapcasa with the thumbalizr.com screenshot-service. Snapcasa was great because it gave me plenty of free captures each month, but it has some serious problems capturing some of the sites I throw at it, and was behaving rather randomly, so it has to go.

I’ve looked at several screen shot services, and tested many, and so far it is thumbalizer.com that seem to be the fastest and most stable, and the free version is able to take screenshots of webpages deeper into the site, not just the front page. As far as I can see I can’t find any limit on the api, but the free version does have a watermark on each thumb. I’m too cheap to spring for a paid account, but you do have that option.

The result so far

Demo: https://pappmaskin.no/opensource/delicious_snapcasa/delicious_thumbalizr.php?tag=art&count=10
Shows: The last 100 bookmarks tagged with “art” on delicious.com by me.


Thumbalizr.com provides a .gz with some php for caching the thumbnails their API provides, but I wasn’t able to get it to work last night. Luckily Anton Lindquist has branched the code on GitHub and made some improvements, and after a little headscratching (aka googleing) and some helpful tips from Anton himself, I am now running a version that grabs the images from Thumbalizer and stores them locally on my server, speeding up the pages quite a lot, easing the stress on thumbalizer, and most importantly, preventing already grabbed pages from being queued again and again.

New default queue image

Thumbalizr provides an OK queue-image while their services works on grabbing a screen shot of the page you request but with some help from Anton I’m not using my own custom image, currently a picture of my son holding a fish (just to make him smile :). It’s nice to have a little more control over what is displayed on the page until the image is ready for use, especially when you do like me and fire off a grid of many screen shots on the same page.

Possible uses

I’ve rewritten my original Snapcasa script into a WordPress plugin which I use on several of my blogposts right now. I’ve also made a standalone page for my sons, a start page with kid friendly games and YouTube-videos etc. They can’t read yet, so it’s nice to have an automated start page with pictures.

The code

I promised to update this post with the code I use for working with the Thumbalizr api and caching images locally. As I said I use this caching script instead of the code provided by Thumbalizr. It comes with an example index.php, that I’ve expanded on a little. Right now it looks like this.

	'local_cache_expire' => (!$config['local_cache_expire']) ? 3600 : $config['local_cache_expire'],
$image = new thumbalizrRequest($config);
if($image->headers['Status'] == 'OK' || $image->headers['Status'] == 'LOCAL') {
} else {
	//print_r($image->headers); //debug
$filename = 'https://pappmaskin.no/wp-content/2010/03/noah-2624545080_417ba06836_m.jpg';
$size = getimagesize($filename);
$fp = fopen($filename, "rb");
if ($size && $fp) {
    header("Content-type: {$size['mime']}");
} else {
    // error
Code Open Source

Delicious Screenshots – my first wordpress plugin

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /customers/7/5/b/pappmaskin.no/httpd.www/wp-content/plugins/delicious_screenshots/wp_delicious_sceenshots.php on line 75 Warning: file_get_contents(http://feeds.del.icio.us/v2/json/mskogly/art?Fcount=6): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /customers/7/5/b/pappmaskin.no/httpd.www/wp-content/plugins/delicious_screenshots/wp_delicious_sceenshots.php on line 75 Warning: Invalid argument supplied for foreach() in /customers/7/5/b/pappmaskin.no/httpd.www/wp-content/plugins/delicious_screenshots/wp_delicious_sceenshots.php on line 79

If this works there should be about 6 thumbnails on this page, showing links bookmarked using Delicious, and tagged with “art”.

Download delicious_screenshots.zip here, version 0.7 of my very first wordpress plugin.

Activate plugin. And add your del.icio.us username to the options page. (under settings in the WordPress toolbar)

14.02.2017: Changed from rss to json and cleaned the code up a bit. Also removed Snapcasa from options.

What’s next:

  1. The first version of this plugin used Snapcasa for creating thumbnails, but I switched to thumbalizr.com to get a higher success rate.
  2. The count param doesn’t seem to do anything when calling the del.icio.us api, it always returns 10 results, so I need to handle that in the code instead. I’ve notified them of the bug.
  3. Testing other screenshotting services or making my own.
  4. Choosing an image from the page metadata when available.
Code Open Source

Playing with SnapCasa screenshots and del.icio.us


Tonights nerdfest will include trying to use the SnapCasa and del.icio.us to generate a lovely page full of thumbnails, one for each url.


1. My 100 latest bookmarked urls from del.icio.us: http://feeds.delicious.com/v2/rss/mskogly?count=100
2. A SnapCasa login account.
3. A server that supports xslt transformation. (I’m running MAMP on my macbook, and pappmaskin is hosted on One.com)
4. A text editor. I’m using Dreamweaver for this, since it has some pretty good tools for building xslt. (Take a look at the Adobe Livedocs for more info on using it).

(More after the break)

Art Code DIY Flash Open Source Portfolio

Open source flash-based sound sequenzer

I’ve been thinking alot about making a soundbased installation in Adobe Flash, using sensors and switches, and I’ve gotten around to making a few small eksperiments/prototypes as research, which I’m planning to share on this site later.

But I also found this old experiment I wrote in Flash 5 (!) and wanted to share it. It is a visual sequenzer (*) / sound toy that lets you drag icons onto a “soundstage”, each icon representing a sample. As you press play a line starts moving vertically, and as the line hits one of the icons, the corresponding sound is played. You can also click, drag and hold an icon, and move it on top of the moving line to trigger the sound. There are two types of sounds. The yellow icons trigger different “wet finger on glass” sounds, and the greywhite icons trigger sonar ping sounds.

Open Source

The code is pretty old, and there are WAY better ways of making something like this with AS3, but still, here is the source code (fla) for it (it also includes the samples, which you are free to use in any way you like).

I still think it is a pretty nice little project, but I am toying with the idea of replacing the click and drag with a webcam mounted in the ceiling, and letting people moving around on the floor trigger the sounds. I have quite a lot to learn before I can make something like that, but I’ll get there!

* Ok, so I guess it is a stretch to call this a sequenzer, but I wanted to create a fun, easy and interesting way to generate a sound collage.


Happy birthday to GNU!

Just got a heads up that the wonderful people over at GNU used one of my pictures in their Happy Birthday to GNU-video. I am of course a big fan of open source in all shapes and forms, so this is simply an honor and a delight! I said jokingly to my wife that “it felt like as if the Dalai Lama had quoted me”, which of course is a SLIGHT exaggeration, but you get the point. I am not a great photographer, so when someone, anyone wants to use an image it simply makes me REALLY REALLY HAPPY!

See the video below, or go to http://www.gnu.org/fry/ to view or download the original.

It’s probably a coincidence, but this is the third time in just a few months where someone has used one of my images in some way. They are all on flickr.com and they all have Creative Commons licences, most of them for commercial use as well, making it easy for anyone to use them as they wish. I am not a professional photographer, so I really have no urge to sell them. If anyone want to use them, then fine!

So, these are the images that people have picked:

Hesttrøa 7 - New bathroom project
photo credit: mskogly

Now, this image of my plumbing is just awful, and I suppose that was the point. I took it as documentation before renovation, it sure ain’t art. But still, it is wonderful to be wanted!

River Walk, San Antonio, Texas
photo credit: mskogly

The San Antonio River Walk is quite a sight, it was a big surprise to find such a lush place in the middle of the city, and after having my senses numbed by the wasteland of the US highway system. A small version of this image is in use on a site called Scmap, go to
www.schmap.com/sanantonio/tours_tour3/p=2048D03/i=2048D03_10.jpg and take a look in the right hand corner. The image was also printed in the Fifth Edition of the Scmap San Antonio Guide. Schmap also makes their guide available in widget form, letting you embed the guide in your blog etc, looks something like this.

And the last image so far:

Highway, Houston
photo credit: mskogly

This Highway-picture was used in an article about Houston in an online magazine for expatriates called Global Connection. I don’t have access to it, so I don’t know what the finished article looks like.

The open source principle VS. the need for an income
I have followed a few debates about how “amateur photographers” encrouch on the livelihood of professionals, making it harder to make a living. There might be some merit to this, but I also believe that there is room for both. The access to cheap or free images makes it easier for more people to create, to write about and promote good things. Just like Google Maps and other map apis created an explosion in new services and mashups, sites like Flickr with a well organized way to search for pictures published with a suitable creative commons licence will lead to a richer flora of online and printed works. And I believe that the work will be a better world for it. Imagine the price of creating a school textbook “in the old days”, it would cost a small fortune in royalties for the images used, often images used purely as illustration of a concept (like pollution). These days, a writer, teacher or pupil for that matter could do a quick search on Flickr and find just about anything they need, for free, and with the permission to use the material in eighter a commercial or non-profit setting. Magic!

Flash NRK Open Source Portfolio

Bomber Jack Clone


I spent a few weeks creating a Bomber Jack clone from scratch for a radio show at NRK, and ended up reskinning it at least 3 times for other projects (easy money). This version was made for the Norwegian election in 2003.


And here is a screenshot from another clone, made for the childens pages at NRK:

Hopp med Fantorangen

Want the code? Drop me a line!