Skydrive is free excellent online storage disk from Microsoft, but has some limitation regarding Link sharing and hotlinking a file from the Skydrive, To download a file from Skydrive, you will have to visit Skydrive
To know more about skydrive, Click Here
If you manage to get a direct download link from skydrive download page, It will stop working after one or two days. Because these download links are dynamic. Microsoft wants Skydrive users to visit their website so that they can keep making money from Ad Views and Clicks.
Good thing about this drive is, it is hosted on Microsoft’s Cloud, So it provides you almost 100% up time with unlimited download access i.e No Bandwidth limit and 25GB space.
People have made scripts to track download links, but most of these scripts are hosted on their own server with no service guarantee.
So I wanted to make a workaround to overcome this problem which is reliable and efficient.
This script is useful for web publishers and bloggers and can be installed on your website or blog in a minute.
- Link Tracker Code
var text = $(this).text();
var replacedcode = '<a href="'+newUrl+'" target="_blank">'+text+'</a>'
var url = $(this).attr('href');
var queryAPI = "http://query.yahooapis.com/v1/public/yql?q=";
var query = "select * from html where url=\""+url+"\" and xpath=\'//div[@id=\"spPreviewContainer\"]/a/@href\'"
var queryFinal = queryAPI+encodeURI(query+"&format=json&callback=");
if (json.query.results == null) newUrl = "http://skydlpage.blogspot.com/p/missing-link.html";
else newUrl = json.query.results.a.href;
Well, here is a video to guide you through the installation. Though I have shown it on blogger blog, it can be used with any webpage, blog service or CMS.
Note: This code will not work for files having extensions doc, docx, ppt, xls or any MS Office file extesion. To use with such files, first zip it and then upload to Skydrive.
After installation, you can start posting Skydrive links on your Blog. Make sure that the link which you are copying from Skydrive is public and correct.
Your copied link will look something like this.
http://cid-xxxxxxxxxxxxxxxxxxx.office.live.com/self.aspx/path to your file/filename with extension
If you post a wrong link, it will just redirect you to an error page.
Please let me know through your comments, if you find any bug or want to tell other modification/suggessions.
Here I list two blogs which are using this code to stream their MP3 files, directly from Skydrive. In next post, I’ll post a vide which will guide you to integrate Yahoo Media Player with Skydrive to play your Media Files on your page: