Searching multimedia sites in Python using public APIs
Search for video clips on YouTube and Vimeo, find slides on Slideshare, or documents on Scribd using Python and RESTful web APIS
Youtube has a big API described on code.google.com, but the most interesting is the gdata API that allows us to manage video clips. Part of the API methods doesn't require any authentication or keys. For example to search for videos you can use this feed: http://gdata.youtube.com/feeds/api/videos?q=TERM&v=2. In Python this feed can be easily parsed with feedparser:
SlideshareSlideshare has its own API, which requires API key generated after free registration. In Python you can use PySlideshare, which covers nearly all API methods. One of unsupported methods is slides searching. To search for slides we have to use the API directly by requesting this method URL with additional GET arguments. Required arguments are api_key, ts (timestamp of the request), hash (a sha1 hash of timestamp and secret key). Here is an example of searching slides using the API: Data is returned in XML format.
VimeoVimeo also has nice API. To use it we have to register and generate the API key. Some methods need only the key, and other are more protected by extra authentication. There is a Python module for this API: python-vimeo, but you can always use the API directly:
ScribdScribd is a document storage website, similar do Slideshare but focused on typical documents. You can use the public API with the help of python-scribd. To use the API you need to register and generate API key. To search for documents we can use:
Examples shown in this article were used to make my media catalogue, that gathers slides, docs and video clips from those sites (except Scribd, which has bit unfriendly API that doesn't pass all data needed to generate the embed codes from search results).