LukasRos' Blog

Expectation vs. Reality

So true …

Dec 2, 2011
A software developer has two skill sets, the programming skills and the non programming skills, from all this the most important skill of a software developer is “Getting things done”. Let’s prove it.
This article elaborates on why “Getting things done” is the most important skill and what it actually means regarding to design, code and testing.
Mar 3, 2011

Open Graph Protocol

In my efforts to write about so-called open technologies I have already brought you an Open Source 101. Today I want to talk about the Open Graph Protocol.

The Open Graph Protocol, or OGP, as it is abbreviated, was designed by Facebook and is used for the Like-Buttons, but every other service can consume and use this meta data as well. It is used to add very simple meta data to websites and is based on RDFa, which is very interesting in itself, but I don’t want to go into detail right here. The basic data added is url, title, image and type. One could argue that title and url is already a part of a web page, but OGP allows to enter canonical values, for example if there are multiple URLs pointing to the same page. The image is used as a visual representation, similar to a Favicon, but larger.

The type is where things get interesting, because a web page can be a description of a person, a thing or a place that exists in the real world, such as an actor, a movie or a cinema. Facebook assumes that if I click a Like-button on this kind of page, I’m not really liking the page, I’m liking the object that it represents (such as the movie). For these real world objects, there’s some additional meta data that can be specified, such as the physical location.

I’ve added OGP markup to my blog. If you also have a blog hosted on Tumblr like this, I’ve prepared a gist of code which you can simply add to your template between <head> and </head>, and it will enter the appropriate data for every article you write:

Jan 15, 2011

Using host-meta with the symfony Framework

If you want to add some Open Web discovery functionality to your website, the first step should be to add a /.well-known/host-meta file to your webserver. So you’ll have to create the .well-known directory and add a host-meta file and then also need some configuration on your webserver to make sure host-meta, which doesn’t have any extension, is served with the application/xrd+xml MIME type.

As an alternative, you may decide to let your framework serve the file, which allows for dynamic generation as well, instead of statically uploading it. If your framework is symfony, the straightforward idea to create a module called “.well-known” and an action called “host-meta” will fail, because these names are not allowed by PHP and symfony. Don’t give up, it’s still possible to have host-meta in symfony. Just add a specific rewrite rule to your routing.yml file:

For sake of simplicity, I’m using static content, so the respective action is just this:

The hostMetaSuccess.php contains the static XRD/XML content, but you have all options to use PHP to generate this file dynamically. Happy coding!

Jan 11, 2011