Archive for August, 2007

Insert SkyDrive Plugin Updated

I have now updated my SkyDrive plugin to include some of the parts of the SkyDrive viewer. So what does the plugin now look like? Well, this:

 

So you can still put the link in as normal if you want, but now you can just sign into the plugin using your Windows Live ID and then browse your own public files and folders and select what file/folder you want to embed. So once you have signed in, click on the Show Files and Folders button, which will load your public files and folders:

Then just select the file you want to insert and click select, then it’s the same as before.

Now, because this uses the WLID SDK, there are certain files that the plugin requires, one of these files Windows Live Writer already uses (msidclr40.dll), but is a much older version and my plugin won’t use this. So I had to try and work out what to do, and after discussing it with the Writer guys, they told me they would prefer it if my installer didn’t overwrite their version of the file. So with the help of Joe Cheng we have got round this by using an exe file in addition to the plugin dll. All of this won’t even be noticed by the end user, but I felt I should point this out for those who have been looking at the souce code on CodePlex (which has now been updated).

Source code: http://www.codeplex.com/SkyDriveEmbedPlugin
Download: http://gallery.live.com/liveItemDetail.aspx?li=27545581-4b54-4f6d-9007-ed3b168dab43

SL

Advertisements

37 Comments

Got Milk? Yes? Ok, Got Popfly?

I have 5 popfly invites to give away. If you would like one, send me a message on here. First come, first served. Please provide an email address in the message so I know where to send one to. No email address = no invite, I won’t be chasing up if you forget.

SL

27 Comments

Insert File(s) Plugin

Ever had a file that you really wanted to upload with your blog and link to it from that blog? What process have you normally had to go through? Publish the blog, then add the attached file and the link it? Upload the file, then publish the blog with the file url? Wouldn’t it be easier if you could just do it all in one go? Now you can, thanks to the Insert File(s) plugin .

Right, now the TV ad is out the way, what is this plugin? It basically allows you to add up to three files to be published with your blog and have the links put in place already, so all you do is tell the plugin what files, then publish your entry. So let me show you it, first off, click on the Insert File(s) link:

This will give you the main window:

Here you can see there are three parts to this plugin, two of them are mandatory though, but I’ll talk through each one. First is the Text to appear before the download link; you might want to have some information text before the link, for example "Download location: ". The second box is for what text you want for the hyperlink part, so what the reader will click on. And finally the file’s location can be got by using the Browse button (the one with the … on it). You also have the option for whether the file should be opened in a new windows (good for if the file is a pdf or Word Document). I should point out now, the text for the hyperlink and the file location are mandatory, they have to be entered, the text to appear before the link is optional.

Now, I mentioned that you can add up to three files, but there’s only the details for one at the moment, so what we do is we click on the plus button, and the window now looks like this:

And as you can see, we can now add the same details for the second file. And for the third file, just click on the plus button next to the second file’s details and the window will expand again.

Now, what blogs does this plugin support? Well the main ones that it doesn’t support are listed in the main window, and they are Windows Live Spaces, Live Journal and Blogger. Other blogs have varying levels of support for file uploads, but I have done my best to ensure testing against all the major ones. Blogs I have tested against are as follows: (the three that aren’t supported), a hosted WordPress blog, a custom WordPress blog, dasBlog, Community Server, MovableType and TypePad (unfortunately, I don’t have a Sharepoint site available to me to try it out on, so if anyone does and tries the plugin, let me know if it works). From that list, some of those blogs will allow you to upload whatever file you choose, some will only allow a few file types (like pdf, doc, zip, but not rar), so if you have a file to upload, it’s really up to the blog provider whether the file type will be allowed and whether you can publish or not.

So what happens if you try and use the plugin for a provider (or a file type) that is not supported? Well, if it’s one of the three mentioned unsupported blogs, you will get the following text:

Sorry, Windows Live Spaces doesn’t support file uploads
Please:
1) Change to a different blog provider, then;
2) Save the draft
3) Change to HTML view, then back to the view you were on.
Your files will be ready to upload then.

The name of the offending blog provider being shown to the user. If you try uploading a file that is unsupported by one of the other providers, you will get this error:

Which brings me nicely onto my next feature; there is a little option that might have been spotted:

If you check this option (it is always off by default), then it tells the plugin that for this blog you have configured an FTP upload option, which means you’re basically free from restriction, including with the three unsupported blogs. Ticking this box means that you can, if it’s configured, use this plugin with say Windows Live Spaces.

Now, once the file has been inserted, the plugin displays a sidebar, which, if I’m honest, I didn’t do too much with it, and as such, it is very basic:
(told ya’ )

Here you can set whether the blog uses FTP (should you forget to check it in the main window), this will automatically change what’s viewed in the text area of Writer, if it’s one of the unsupported blogs. You can also change the files, remove some, add some, change what’s there, clicking on this will simply bring up the same window as before but with all the fields filled in as they were originally.

As with my previous plugins, this one is also on CodePlex. Feedback as always can be left as a comment on here, or emailed to wlm@scottisafool.co.uk.

View Source: http://www.codeplex.com/InsertFiles
Download Plugin: http://gallery.live.com/LiveItemDetail.aspx?li=b839fc2f-afa0-4728-8f54-cf4c0d3be8f5

SL

(Oh, and yes, I’m aware of making this on a blog provider where I can’t fully demonstrate the plugin’s capability )

28 Comments

SkyDrive Viewer

I decided at the backend of last week that it would be cool to have a play around with the Windows Live ID SDK for the client applications, the main reason for thinking this was seeing the format of the SkyDrive links, they start with http://cid- and then have the user’s CID code after it. So I checked to see if the cid was given as a property in the Windows Live ID SDK. It was. So with that in mind I began to wonder what I could actually do with that. In the end, I thought of doing a little application that allows you to log in using your Windows Live ID, then gets you your own public files and folders on SkyDrive. Trouble with that is there are no APIs currently for SkyDrive, so I was going to have to rely on screenscraping.

And so, one weekend later, I have created my little reader, which also allows you to download the files that you can see listed. I guess you would like to see some screenshots

I’m quite pleased with this little app, it took a lot of frustrating hours to get it sorted. I bet you’re curious how I put it all together; well, if you are, then head on over to CodePlex, as I have put it up on there, along with the release download.

Any issues, please leave a comment or send me an email (wlm@scottisafool.co.uk). Oh, and stay tuned for an updated to my SkyDrive plugin for Windows Live Writer.

Source Code: http://www.codeplex.com/SkyDriveViewer
Download: http://www.codeplex.com/SkyDriveViewer/Release/ProjectReleases.aspx?ReleaseId=6539

SL

36 Comments

Another New Plugin: Insert SkyDrive Embed Code

This last week saw Windows Live SkyDrive get released into open beta, changing its name from Windows Live Folders to its new incarnation. With it came a lot of new features; one of these was the ability to embed a link to a file or folder in your blog post or website. So I figured a plugin could be useful here for Windows Live Writer to give an easier way of embedding that code.

For this plugin, I decided that I would write it using Visual Studio 2008, so this is my first plugin to come straight from Microsoft’s new IDE, and with it came a couple of teething problems with the installer which are now resolved. So how does this plugin work? Well, you take the address of what you want to embed and put it straight into the plugin:

Choose how you want it to appear on your blog page and you’re set. Now, you might have noticed the Use iFrame option, this is for blog providers who do not allow the <iframe> tag within blog posts: if your blog doesn’t allow it, then uncheck it and it will put different code in, but will basically give you the same results.

As with my other plugins, I have also put this on CodePlex.

Download link: http://gallery.live.com/liveItemDetail.aspx?li=27545581-4b54-4f6d-9007-ed3b168dab43&pl=8&bt=9
Source code: http://www.codeplex.com/SkyDriveEmbedPlugin/

SL

32 Comments

Facebook and Windows Live Toolbar Buttons: Creating your own

I got bored yesterday, so to satisfy an hours’ boredom, I took a look at the buttons on the Windows Live Toolbar as you can easily create your own. There are two ways of doing it, the easy way, or the more advanced way, which I will now go into:

The Easy Way

The easy way is basically going to the button creation page on Windows Live Gallery and just fill in all the relevant details:

You can even have the button act as a search. An example of this would be for doing a Live Search, you would use this link http://search.live.com/results.aspx?q={query}&mkt=en-gb&FORM=LVCP which we just put in the Add Search section:

Then we just agree to the terms and create our button, which you can then put on Live Gallery straight away, or download if you want to host it elsewhere.

The Advanced Way

The advanced way requires us to head to the MSDN pages for the Toolbar section so we can see what can go into the button. This shows us the structure of the XML file needed for the button. If we took the above example of doing a Live Search button, then in the <shortcuts> section we would have the following:

<shortcuts> <buttonWindow href="http://search.live.com/results.aspx?q={query}&mkt=en-gb&FORM=LVCP" width="350" height="100" /> </shortcuts>

So to try all this out, I used the Share with Facebook shortcut that Facebook provides for sharing webpages with your friends. The shortcut itself is just a bit of javascript, but I had to modify it slightly to work with the button. In the javascript, I changed l=d.location to l={url) which uses the {url} variable to get the current page address from the browser.

So my finished XML looked like this:

<?xml version="1.0" encoding="utf-8"?>
<button>
  <buttonNamespace>ScottIsAFool</buttonNamespace>
  <buttonUpgrade />
  <locale language="*">
    <buttonText>Share With Facebook</buttonText>
    <tooltip>Share this page on Facebook</tooltip>
    <icon src="facebook.bmp" />
    <shortcuts>
      <url href="javascript:var%20d=document,f='http://www.facebook.com/share',l={url},e=encodeURIComponent,p='.php?src=bm&v=4&i=1176212157&u='+e(l.href)+'&t='+e(d.title);try{if(!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z){a=function(){if(!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=0,width=626,height=436'))l.href=f+p};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)" />
    </shortcuts>
  </locale>
</button>

Which uses this bitmap file . Save this XML file as button.xml, and along with your image (if you used one), put them into a cab file (not zip or rar) and rename it from .cab to .btn. You can then submit this to Windows Live Gallery, or if you want to host it yourself, you would use the following link: http://toolbar.live.com/addbutton/?btnurl= and put the direct URL to the btn file after the =.

My Facebook example can be downloaded from http://gallery.live.com/liveItemDetail.aspx?li=8e97a24a-4794-45ca-86aa-4b0ef603344f

SL

14 Comments