NOS is a dutch public broadcasting organization focussing mostly on news. Some months ago, NOS announced opening up their data by offering an API which would give access to (some of) their data. Today, the API is opened up to the public and developers who requested API keys will start receiving them. To make it easier for developers to use the API, I've developed a PHP5.3 library.
Basically, the phpOpenNOS library is nothing more than a layer between the API and your application. It is there so you don't have to develop the code to make the requests to the server. At this point, it implements all documented functionality in methods of the OpenNOS class. What you get returned are model classes with getters for all information the server returns.
It doesn't do any more than giving access to the API. Anything you want to do with the data, you'll have to implement yourself.
As mentioned before, all functionality is implemented as methods of the OpenNOS class. So using this class, you have access to all the API methods. In the repository there is an example.php file that gives you some examples, and more in-depth documentation will follow soon. The code is quite easy to follow though, so probably looking at the method signatures and the docblocks should give you enough information on the available options. A simple example for fetching articles:
<?php require_once 'src/phpOpenNOS/OpenNOS.php'; $nos = new phpOpenNOS\OpenNOS('YOURAPIKEYHERE'); $articles = $nos->getLatestArticles();
I already mentioned the repository above, but the code is available from Github. It is the first public repository on the new Ingewikkeld account, which is the account of the company I run with my wife. Because I'm using Github, I would recommend everyone to fork the repository and if you have any improvements or bugfixes, send a pull request so I can get in your fixes and improvements into the main repository. Get phpOpenNOS here at Github.
As mentioned, documentation is something I need to add. It will come, and hopefully it will come soon. In the README, you will also note that error handling is still in the TODO list: At this point there is no good error handling in place so I will have to add this at some point in the (near) future. Of course, I will keep following the development of the API and adapt the library to any changes in the API as well. And if you have any feedback on phpOpenNOS, I would gladly hear from you!