I’ve continued to poke around with mashup servers. If you caught my first piece on this topic, you’ll have a clue what I’m talking about. Since I got the WSO2 mashup server working, I’ve stuck with this tool for now. I worked my way thru the introductory materials and a first example. What I would like to do is create a mashup of the various blogs and forums I’m active on so that I can have one spot to check into them.
I discovered a few things about this server that I thought I would write down so I could remember them – and perhaps they might be useful to another newbie:
- The Hello World Step 2 instruction is not really correct. This will not work because most browsers prevent this kind of cross-domain scripting action. I have not figured out how to enable this. I posted a question to WSO2’s forums.
- The examples on the WSO2 site are much better than the ones that ship with the tool.
- The mashup server recompiles stuff on the fly making debugging easier.
- I modified my startup habits. I like to see the console logs and error output. I modified the staartup.bat file in in the bin and turned echo on and then got rid of the “start” part of the system call. What this does is that t runs the server in the current DOS box rather than in a separate window so if it ad-ends I can see why.
Jonathan Marsh wrote a really nice RSS feed service to power his screen saver. This is a prime example. I grabbed it, messed around, and had it working in no time. Really a nice job with good explanations. Jonathan’s example shows how to cache content as well. This was a little tricky to figure out. What you need to do is literally copy and paste the code from the stub for the storexml service and save the file as storexml.stub.js in your service’s resource folder (in this case “nationalgeographic”). When you actually run the server, your XML cache will get created under the storexml.resources folder in the scripts directory.
What this program does is create a feed that can drive Google’s screen saver. The screen saver reads in a RSS 32 stream that can contain pictures. So this automates the “feeding.
The next example to look at is Tyrell Perera’s Tomato Tube example. This shows a ton of features and gets into feeds and RSS a lot. Very useful! (A side note – but see my “rules for selecting frameworks” – because these guys are golden so far on “good documentation and samples”)
I started modifying the tomato tube example in simple ways to suck in multiple RSS feeds. This is really quite simple to do using a few lines of code:
var rssUrl = “http://tarnaeluin.wordpress.com/feed/”;
var feedReader = new FeedReader();
var rottenTomatoesFeed = feedReader.get(rssUrl);
var feedEntries = rottenTomatoesFeed.getEntries();
With that I’ve connected to the external source and sucked back the entries in the RSS feed into an array for processing. You can grab the rest of their code from the site and check it out. I’m going to keep at it with this ans see where I can take it…maybe I can get some gravy for my taters 🙂