Webslices in WordPress

Posted by beakersoft | Posted in Programming | Posted on 24-03-2008

15

WordPress and Webslices header

One of the new features in the beta of Internet Explorer 8 is something called Webslices. These work in a similar way to RSS feeds, but allow you to subscribe to a section of a web page, as opposed to just a feed. The section of the page you subscribe to is a div with a class name of hsclice.

If a page contains webslice’s that can be subscribed to, a little purple icon shows in the IE tool bar, along with any rss feed options for the page. If you click on the webslice option a new link appears in the favorites bar, when you click on this you get the contents of the div. If the content of the div is updated, the item in the favorites bar shimmers and goes bold to inform you of the update.

Webslice

So, I have written a small php script that can be used on a WordPress blog to subscribe to the 7 last posts as a webslice. At the moment all I have is a script, but if people are interested I can turn it into a WordPress plugin. You can download all the parts as a .zip file at the end of the post, but here is what it contains

  • readme.txt – This file contains the bit of HTML code you need to insert in your index.php file (or where ever you want the webslice subscription option to show) and more detailed install information.
  • webslice.php – The actual file that contains a div with the last 7 posts
  • webslice.css – Style sheet for the php file

When you have downloaded the files, change the css to suite you, insert the div code into your page, upload to the server and away you go.

More Info on the script

When I first looked at adding a webslice to my WordPress blog, I thought i would just place the hslice div around the existing previous posts section in my side bar. I went away from that idea though as I wanted the ability to format it differently, maybe add a graphic to the bottom etc so i went with an external file.

To make the page flag as having a webslice, but re-direct it to another page for the actual div, I used the class=”feedurl” option in the div. This just tells IE to look in a different place for the actual content. You can tell it to look at a page or an rss feed. The div containing all this info is hidden so it doesn’t interfere with any of the existing front page content.

The script it’s self is very straight forward. It just looks in your WordPress DB for the last 7 (you can easily change this) posts , and puts them into n unordered list on the page, the formating is controlled by an external style sheet.

Please note this might not be 100% reliable. IE 8 is still in beta so its possible (but unlikely) the way it handles Webslices could change. I have also only tested this on one machine running the new IE, so it might not always work right. If you have problems get in contact and ill try and iron them out.

As I mentioned before if there is enough interest I might turn it into a plug-in

Edit: Since upgrading to the release version of Internet Explorer 8, any web slices I had suddenly stopped working. All I kept getting was ‘page cannot be displayed’ error in the space where the slice was. After much searching and head scratching I finally found the solution at http://support.microsoft.com/kb/969213

It turns out that Google Gears was stopping them from working, just disable the add on in IE and they start to work fine again

Download The Zip Archive

Download the script: wordpress_webslice.zip

Accessing the Spiceworks Database – Part 1

Posted by beakersoft | Posted in spiceworks | Posted on 11-03-2008

4

Header

When I first started to use Spiceworks, one of my main complaints was that you couldn’t access the data outside of the Spiceworks desktop interface. Well, turns out I was wrong.

I first had my eye’s opened from this thread on the Spiceworks forums. It informed me that it uses a SQLite database to store all its information. So, I asumed getting at the data would be easy. As with most things I was mistaken.

Internet Explorer 8

Posted by beakersoft | Posted in Applications | Posted on 09-03-2008

0

Last week the boys over at Microsoft launched the first beta of Internet Explorer 8, you can download it now from http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Install.htm (be warned its a beta so could go pear shaped yada yada ya)

Reading through the docs, looks like the main new thing with this version is improved compliance. Finally, it might be possible to create a website that looks (and behaviors)  the same in all the Major browsers, without having to put in a lot of extra code and css. Only question I have is why the hell has it taken them so long (and were they scared by the impending release of Firefox 3?)

However, not to jump on the Microsoft bashing bandwagon to much, there are a couple of cool new features in there that might prove to be useful. You can read more about them at Readiness Toolkit page, but they are:

  •  Activities – Now when you click on the IE8 page menu, you get a list of activities you can perform on that page. These include thing like sharing it on Facebook, Digging the page, Translating the page, blogging the page etc. There is a framework for this that allows you to create your own ‘activities’, so you are not limited to what they want.
  • Webslices – This for me is the most interesting new function. You can add some code to your websites so that the user can subscribe directly to content on your page. Its kind of like a better version of RSS integration with the browser. You can do things like subscribe to Friend status’s on Facebook, when you hit the webslice (it lives in the favorites bar) a drop down appears with pics of your recently updated friends, there status and the time of the status. I am going to try and code a simple one for this website hopfully this week, and ill post my findings up.

Something else that occurs to me is that are they trying to take on traditional RSS feeds with there webslice function, and how long will it be until there is a Firefox extension that will emulate it?

Spiceworks update

Posted by beakersoft | Posted in spiceworks | Posted on 04-03-2008

0

Last week a new version of Spiceworks (2.1) was released. You can see the official release note at http://www.spiceworks.com/2.1/, it mainly seems to me like a bug fix release, but there are a couple of new features. Once you run up the console it should download the update for you (as long as you are online of course)

One thing that has caught my attention is they are using feedback from the community to drive the product forwards. According to the press release email, they visited an office in New York and acted on there suggestions. You can also request a feature be added through the feature request forum at http://community.spiceworks.com/forum/1

If you feel like there is something missing from the product get on here and let them know. I am going to log a request now that they open up there database a bit more so you can use external products (Reporting Services, Crystal etc) to pull data out.