An API for SkyDrive (facilitating a direct URL to the file)
SkyScraper: an API for SkyDrive
*** Update: there is now an official API for SkyDrive! ***
I recently created a simple API for SkyDrive. It's a very small .NET library, which I have rather appropriately named "SkyScraper".
SkyScraper provides one very useful method. Pass in the URL of the main public page for a file on SkyDrive, and get back the direct URL of the file on SkyDrive. This solves one of the biggest problems with SkyDrive, and makes the service very much more useful.
If you want to try it, contact me and I could send you the SkyScraper DLL to integrate SkyDrive with your own website. Or you could just use the special redirect URL I've already set up, to create a permanent direct URL to any file on any SkyDrive. Full details below.
An important limitation of SkyDrive: no permanent direct URLs for files
For most file types, SkyDrive does not provide a permanent direct URL. The URL of the main page for the file is permanent, but the direct URL is not. For instance, the direct URL for a video file on SkyDrive is temporary. It can change. So if you embed a video file on SkyDrive on a web page, the next day it will probably stop working. (The direct URL is not even displayed. It's there in the HTML, but if you want it you have to go and find it. Apparently Microsoft did not intend SkyDrive to be used in this way. Therefore this blog post is purely for academic purposes.)
Working demos of my SkyScraper library
I used my SkyDrive API to set-up a dynamic redirect URL, which takes the URL of a public page on SkyDrive, and routes it to the current direct URL of the file:
We can now have a permanent direct URL (permalink) to any file on SkyDrive, through this redirector!
Hot tip: notice that the URL of the main SkyDrive page for the file is passed as a query string parameter, "pageUrl". This query string parameter obviously therefore needs to be URL-encoded.
I used my redirector to produce a working example of a media player with the content hosted on SkyDrive:-
embedding video/audio from SkyDrive on a web page.
Terms & conditions
You can use my redirect URL right now to create permanent direct URLs for files on SkyDrive. You could also use my SkyScraper library to create your own solution -- it's open source and free to use under a standard GPL type licence.
BUT please do not use my redirector URL or my library without permission. I will require an acknowledgement where these are used. I need to keep track of who is using these! :)
27 October 2009
Tags: skydrive api skyscraper library .net dll free open source sky drive video audio files stream streaming embed mp3 embedding player direct link permanent url permalink file download code source unofficial hack day mash up prototype beta