Tag: html
after 100 days of unfake.it
by Thomas on May.07, 2009, under tech
Hi there!
I have to thank you! All of you, using unfake.it as URL shortening service!
It’s been 100 days, since I faked the first URL with unfake.it - my very own URL shortening service. I started this project, ’cause I always forgot the names of all the other URL shortening providers, so I very quickly wrote my own application, which now is used every day by lots of users.
What began for my personal use only, has now become a huge and important project. A few days after the initial launch - and even without heavy announcement, the first people started using unfake.it to shorten URLs. Using the bookmarklet, some friends and co-workers started using unfake.it and spreading the URL all over the world.
Then, I implemented an API and wrote a standalone WordPress plugin to shorten URLs for new blog postings before sending them to Twitter. Since March, this plugin is downloaded and installed on new WordPress blogs almost every day a couple of times, which really makes me proud. Today, several co-workers as well as absolutely unknown users all over the globe are using my plugin. And there’s an huge number of hits per day:
Then, I implemented the magic preview function with thumbnailed images of the destination websites. Then I wrote a facebook application to add faked URLs and their thumbnails to your facebook profile. Those are just toy-like features, but I relly like them - as well as lots of users.
Some facts of what has happened so far (or is happening):
- more than 3.000 URLs have been faked up to now
- there are more than 42.000 hits to those URLs up to now
- the last 3 days, more than 100 new URLs have been added per day
- URLs for more than 130 unique websites have been faked up to now
- the WordPress plugin has been downloaded and most likely installed more than 80 times
- Twitter knows more than 850 faked URLs of the last 7 days
- Google knows more than 20 pages of faked URLs
- unfake.it is growing every day
I’m really looking forward to unfake.it’s future. Sure, there is an increasing number of shortening services, but I guess, some of ‘em will disappear again.
Bye, T.
HOWTO grab and thumbnail websites
by Thomas on Feb.09, 2009, under tech
Hi there!
Because some of you asked, how I realized the grabbing and thumbnailing of whole websites (here’s an example and I wrote about that in this post), this is a brief HOWTO.
Imagine, you have a Linux system without graphical support. How do you display complex graphical content and make a screenshot? Here it comes: grabbing websites on a Linux system is quite simple.
Prerequisites:
- a Linux operating system (Debian is fine)
khtml2png(I usedkhtml2png_2.7.6_i386.debfrom here)- a running X server (
Xvfbdoes it for me) kdelibs4c2alibkonq4
This is it!
The trick now is: on a system working as a server, you usually don’t want to have a running X server. So, I just installed Xvfb, which is a “Virtual Framebuffer ‘fake’ X server”. It is running in the background and khtml2png uses its display.
First, install Xvfb and several libs:
apt-get install xvfb kdelibs4c2a libkonq4
Hit ‘y’ to solve dependencies!
Now, get khtml2png from http://sourceforge.net/projects/khtml2png/ and install it:
dpkg -i khtml2png_2.7.6_i386.deb
Then, start your ‘fake’ X server:
/usr/bin/Xvfb :2 -screen 0 1920x1200x24
Of course, you may reduce the resolution to your needs. But remember the display number (:2) you set for Xvfb.
And finally, you may use khtml2png to fetch any website you like:
/usr/bin/khtml2png2 --display :2 --width 1024 --height 768 http://www.thomasgericke.de/ /tmp/website.png
Don’t worry about the fact that the package is named khtml2png and the binary is called khtml2png2. It’s okay!
I have a little magical wrapper around that stuff which gets URLs out of a database and performs some checks. Images are save with wget and converted to PNG, websites are fetched with khtml2png. Both are saved and thumbnailed on-the-fly with PHP.
I call khtml2png via cron like this:
/usr/bin/khtml2png2 --display :2 \
--width 1024 \
--height 768 \
--time 42 \
--disable-js \
--disable-java \
--disable-plugins \
--disable-redirect \
--disable-popupkiller \
http://www.thomasgericke.de/ \
/tmp/website.png
My script is started every minute and checks if new URLs have to be fetched. It also checks if existing PNGs are older than 24 hours and, if so, the URL will be fetched and the PNG overwritten.
Just let me know, if you have any further questions.

