Fun with nokogiri: Screen-scraping ikea.com

I recently discovered that ikea is really scraping-friendly – they have their categories and products belonging to a category all linked very clean, and the product pages themselves include, as json, the complete product data necessary to display a product somewhere else ( say, on an iPad ). They also feature the assembly instructions linked as pdf and more fun stuff. Just open any product page and browse the source, you will discover a field named “jProductData” which is just what you want.

So i decided it’s time for me to try nokogiri, a beautiful and fast framework for processing urls and searching through the HTML. I managed to write a scraper in only very few lines that actually works. Since the json is embedded in regular JavaScript, i had to use rkelly to parse the javascript part and extract the right data.

For the datamodel, I used ohm with redis, which takes about no time to setup and works as advertised.

If you are curious, the source is available at github.

impressive, prezi and other ways to kill PowerPoint

I’ve to admit, I haven’t used PowerPoint for 4 years, mostly because no one wanted me to present anything. Times have changed, I had to do 4 presentations in one week lately. Being forced to communicate through slides, I experienced a bit, and here’s my conclusion.

The first presentation was built using Keynote, which is part of iWork, Apple’s Office counterpart. Creation was really simple, the look is just amazing ( especially the transitions ), but there is one problem: I don’t have a mobile Mac at the moment, so I needed to use a friend’s MacBook to do the presentation. This is definitely a bit of a pain, considering the fact that he’s most likely not always around, and exporting to PowerPoint kills all the USPs. There is a workaround though, you can export presentations as .mov files, movies that halt on every transition and continue only after you press a key.

Second presentation, Latex Beamer producing PDFs. The ugly part is the creation, certainly. Unless you are fluid in a text editor, command line and the reading of technical documentation, this might not be your premier choice. After you’ve gracefully managed to create some slides, the output looks great and the best point about it is that any netbook will do just fine for the presentation. I used my Ubuntu-equipped machine and it worked well using the default PDF-Viewer.

Sven showed impressive to me today, a great way of tuning your PDF-only presentations by adding transitions, overview pages and other handy accessoires to finished PDF-Presentations. It’s written in python, has some dependencies ( nothing that easy_install couldn’t fix ) and works really well.

The third presentation kicked off using Google Docs. The presentation ( about Google Go ) had no style, no transitions, was built in about 10 minutes and.. worked. Nothing more, nothing less. It clearly did it’s job, yet there are, at least by now, a bunch of more pleasing ways to get the job done available.

Because a lot of people are really excited about Prezi at the moment, I decided to give it a shot. The presentations created are really different from what presentations have been in the past, it looks.. amazing, is easy to use, features a free plan. It depends on flash, which is somewhat a drawback and is, at least for me not a choice at the moment. Why? Well, first of all, there is no way to create custom styles, you are basically limited to what Prezi offers. The next problem is the lack of a free offline editor ( Google Docs is able to do that ). And of course, what you create looks create, but either I missed the feature that says “copy region from one Prezi to another” or it’s not there. Either way, without it, reuse seems impossible. Still, if you have only 3 minutes and need to deliver a stunning performance, you should go with Prezi. ( Edit: Benny just posted something about Prezi a few days ago, too )

A day at the Android Developer Lab World Tour in Zürich

What would you do if you had the chance to meet some fellow android developers at Google’s Europe HQ in Zürich for free? Yes, you register and go there. As did I, we. Unfortunately, someone at Google’s messed the times up, which lead to us having to depart in Stuttgart at 6am rather than 10am, but nevertheless we made it on time.

What’s the impression of the Google HQ? It’s quite hard to remain objective and unimpressed, so the report may well be seriously biased. Sights along the way in: Streetview car, Google Sign. No suits. Sights in the entrance area: Pool table ( playable ), fridge, Google Sign. Very colourful, nice. Once we waited about 10 minutes we were guided to the conference location, which was also located on the ground floor, right next to the cafeteria and the ( ! ) gym. The overall impression on the way there was that it’s actually not a place that’s perfectly suitable for working there, but it’s a place where living might be fun as well :-)

We had to wait some time until the event kicked off, but the time was spent more or less usefully setting up wifi, talking to other developers and the android stuff ( specifically Reto Meier who held the talk ) and drinking free coke. The event started, but was interrupted to give away free nexus ones. This came not really as a surprise as a) the boxes were located next to the entry, so it was not hard to spot and b) most of the participants I talked to followed the other lab sessions e.g. in Berlin and Paris. But forget about surprises, it’s so amazing to get a phone for free ( actually, it’s even more amazing if it’s the second one ). And what can I say, it rocks, you need to play with one for a little while, forget the iPhone, honestly.

After about half an hour later, the talk finally began, very interactive, very well-held. It basically included a what is android-primer, as well as some focus on technologies available and best practices. After a short while ( let’s guess it was 30 minutes ), we switched over to having .. lunch. And damn, it was tasty like hell. Just like the whole day, all people were nice, friendly, it was a really great atmosphere even just to eat.. wow.

The second part of the talk focused on some code examples, and afterwards, the fun part of the event began: the big bang question session. I had some prepared, as had almost all other people there. And it’s just great to talk to someone who knows ( omitting the should here ), and gives you a clear answer. Reto Meier, again, did a great job on this.I also showed some people qwerted, and I guess some even liked it :-) . There is one app I really want to recommend, it’s called Music Queue and tries to change the way we listen to music and organize our on-the-fly playlist. Great app, cool developer!

What can I see? We left too soon ( for my impression ), and I need to work there. Like, really. Unfortunately, picture taking is generally not allowed on the premises, yet we were able to take some at the conference room itself.

Thanks to all the great people there, was a really cool day.. next year again, hm?

<embed type=”application/x-shockwave-flash” src=”http://picasaweb.google.com/s/c/bin/slideshow.swf” width=”400″ height=”267″ flashvars=”host=picasaweb.google.com&hl=de&feat=flashalbum&RGB=0×000000&feed=http%3A%2F

Facebook Programming Challenge

I just read some very interesting programming challenges located at facebook. Though time is certainly a precious resource, I consider it crucial for a programmer, especially if the claim is to be a good one, to take some challenges from time to time, be it implementing a complex algorithm or solve puzzles like the facebook ones. 

Time is a limited resource. So I’ll better hurry in doing something, otherwise I’ll be forever stuck in the 80% completion state with too many projects around here. 

By the way, I’m totally unsure whether to choose git or svn for my next project. Any tips?

The dying MacBook: Early adopters fate.

So it is. I have a MacBook, the beautiful ( at least it used to be ) white, 13″ screen, first model. But as with any living being, death is certain and signs for its arrival are mostly undeniable. Would my MacBook be a human patient, he would be approaching multi-organ failure. But let’s step over to the comprehensive list of failures.

Bluetooth seems to work only when Moon and some other planets are in a constellation allowing certain, yet to be discovered, microwaves to be sent to the outer world, thus enabling bluetooth. I can assure you that this planetary constellation is indeed very, very rare and so is my bluetooth.

I wouldn’t bother just because of a broken bluetooth device, but fun is that one of the two USB-Ports seems to have been infected by the same disease little Bluetooth already has. Random failures. Just random.

There are days when I just don’t care about these little details. Its the days when the display starts to flicker. I’m not the only one ( the above reported issues are also well-known ), as you can see here. I’m glad to have a external display allowing me to take back control – and actually see it!

That’s it? Nope. Battery life is over, okay, no comment here, just normal. But case life too? Actually its broken in two places, and it appears to me to be just lousy. really. I’m quite confident though that it won’t happen with a new Alu MacBook, which I’m going to buy as soon as I find out about my fathers credit card number. Any hints welcome.

Good night.

Update: After I posted this here, my ComboDrive began making strange noises. And hasn’t stopped doing that since. Hmlz.

OS-Developing Challenge

A good friend of mine, Max, studying computer science in Karlsruhe and I decided yesterday that all currently existing and established Operating Systems suck. This is nothing new. Really not, there are some million users knowing what I’m talking about.
So our goal is to develop an Operating System without any legacy stuff ( No, no serial port support.. ) that is easily extendable and based on some kind of microkernel yet to be developed. And no, we don’t have too much time, just too less fun. Anyway, I’ll keep you updated here. I’ve gotta go back to reading Tanenbaum, great book.