Add new Services without changing the database
Jul0
Up to today, if you wanted to create a new Service for NoseRub (like Flickr, delicious, Reddit, Twitpic, etc.), you would have to write a nasty SQL statement to make this Service available to the NoseRub installation.
This was not only source for many potential fatal mistakes, but also a mess when more than one person wrote a Service at the same time. Due to some incrementing IDs, you could end up adding the same ID for different services.
Today I made some changes to the way Services are handled. They are no longer identified by an ID, but their Name, which makes much more sense. You also don’t need to manipulate the database anymore. Just drop the Service icon and the Service class to the right places (/app/webroot/images/icons/services and /app/models/services) and call the /system/update URL afterwards.
An example of how such a Service can look like can be found here.

Details may change in the next couple of days/weeks, as I don’t like the anonymous ID for the service_type. Their values are currently defined in the bootstrap.php.
9 as the service_type for Brightkite here means that this is a service which items represent locations. This way NoseRub allows you to filter the activity stream. You’ll find the filter on the right side. Try it out!
Enjoy this article?
Consider subscribing to our RSS feed!
No Comments
No comments yet.