So, another in a series of posts where I package up some code I often use into a reusable library, let me introduce a simple PHP library for creating virtual pages.

Virtual pages are pages on a website that are generated in code, and are sent to the client’s browser, but don’t correspond directly to a physical file. This process requires mod_rewrite on Apache, but similar functionality exists in other web servers.

Defining your endpoint

You must specify your endpoint, and then a handling function. This function can be anything callable; functions, methods or an enclosure.

Writing your endpoint handler

You then trigger the handled pages by writing a page handler, and then directing Apache to redirect unhandled requests to this endpoint.

Example endpoint:

And your redirect code:

Hopefully this’ll be useful to someone!

» Visit the project on Github...

opengraphlogo So, I needed a simple open graph library for a project. There are other libraries, but I just needed something simple and quick, so I bashed this library together.

The library contains a class with a single static function, you pass it some page contents, and it’ll spit back a key => value array containing any open graph entries in the page.

This was handy for me, it might be for you 🙂

» Visit the project on Github…

I got bored one evening, so I hacked together the beginnings of an API library for latakoo Flight. Currently it’s available in three four tasty flavours – PHP, Python, Ruby and C# .NET / Mono.

The libraries are minimal but functional; they let you perform both anonymous and authenticated queries against the latakoo API endpoint, but I’ve only had time to add method wrappers for a few of api calls. Feel free to fork the project to help flesh these out!

Hopefully these libraries will make it easier to get the power of latakoo behind your project, and be sure to check out Latakoo to find out how to share video on the Internet.

Happy hacking!

» API Documentation
» Github Project Page