RSS good for feeds, not for real-time data transfer
I recently wrote about WidgetBox breaking my live stock quote widget by disallowing data in CSV text format when using their proxied XML-HTTP request functionality. (See "WidgetBox tightens up AJAX interface")
As an alternative, I set up a Yahoo! pipe to supply the data in RSS format, which seemed to work well.
The problem is when a person stays on the page hosting the widget in order to watch the quotes update throughput the day. After half an hour or so, the widget stops working. There appears to be some kind of strange caching going on that prevents any data from being returned. I tried the usual work-around: appending in the query string a key/value pair containing a random number but to no avail.
My eventual solution was to create a Google gadget with the same logic that retrieved data from the original source in CSV text format. This gadget was then embedded inside the WidgetBox widget.
With a little fooling around, I was able to pass the user configuration data through the WidgetBox widget to the Google widget and, once again, things seem to be working fine.
The bottom line is that RSS just does not seem to lend itself to continuous data retrieval for applications like real-time quotes. It is hard to be sure exactly where the problem lies but either WidgetBox or Yahoo! or both treat RSS as an information feed, not a raw data feed. As such, the assumption is that one wouldn't want to continuously retrieve an RSS feed as I have been trying to do.
So far, it appears the Google libraries offer more flexibility than the WidgetBox approach but at the cost of more programming effort. For those with good Javascript expertise, however, programming gadgets should not be too hard.
Labels: Google gadget, Widget, WidgetBox
WidgetBox tightens up Ajax interface
We just experienced a major problem with the widgets that retrieve stock quotes from Yahoo finance.
It is fixed now but it was a frustrating experience while I was trying to correct the situation. Here is what I believe happened.
The widgets used a proxied XML-HTTP request via the WidgetBox servers that allows us to retrieve data from the Yahoo domain no matter what domain is displaying the widget. It appears that WidgetBox has tightened up their criteria as to what constitutes a valid XML-HTTP response. We were retrieving plain text, no XML at all, and it stopped working.
Our solution was to create a Yahoo Pipe that retrieved the text-based data and transformed it into an RSS feed. This was done by renaming the fields to comply with the typical RSS structure and then render it as RSS. We had to cheat a little here. The fieldnames that can be used are as follows: title, description, category and link. We mapped our stock data to these four fields. Luckily, the content doesn't matter so we can use these four fields for any data item we wish.
In any case, WidgetBox is happy to pull in the RSS as an XML-HTTP response. We are then able to pick up the data from the nodes in the XML response and display it as needed. Problem solved.
Stock Market Monitor using WidgetBox Widgets
I have put together a collection of stock market related widgets at WidgetBox. This post suggests a use for the whole bunch.
First, I'd like to list the widgets:
- LiveStockCharts
- LiveStockQuotes
- Articles from SeekingAlpha.com
- Stock Market Update RSS feed from Briefing.com
I pre-program the LiveStockQuotes to display major stock market averages and my favorite stocks of interest. I have four sets of LiveStockCharts on the page that I can use to monitor the price action of multiple stocks at the same time.
Every once in a while I hit the Refresh button on the Market Update RSS feed from Briefing.com to get an idea of what's driving the market at the moment. With the Refresh button, the widget displays the newest updates but I don't have to re-load the whole HTML page.
I keep the SeekingAlpha widget on the page so that I have ready access to the latest articles and opinions on stocks I might be interested in.
Currently, I have this Market Monitor configured as a simple HTML page on my desktop that I keep up all day so I can check the market whenever I get a spare minute. Here is a link to an example: view Live StockCenter. Enter your own ticker symbols and try out all the charts and analysis tools that are included.
LiveStockQuotes Widget
This is probably my best widget so far. It will display stock quote data including current price, change in price since previous trading day and percent change for one or more stocks, ETFs or indices. It updates throughout the trading day (US markets only) at 30 second intervals.
You can set this up so that it automatically displays your whole portfolio. You can set it up so it displays all major indices. Or you can set it up so that you can enter the ticker symbols of those equities you are interested in at that moment.
There is a simple form in which you or other users can enter a list of ticker symbols, separated by commas. The data is displayed in a tabular format. You can set up the widget so the form is hidden and only the stocks you entered at initialization can be displayed.
This widget is a bit wide at about 260 pixels but it offers lots of flexibility and is one of the few quote widgets that updates continuously. Data is obtained from Yahoo. Index data is up the minute, all other data is delayed by 15 minutes.
Check out the LiveStockQuote widget now at WidgetBox.com
New Widget - Live Stock Chart
I have developed a new stock chart widget. It is available at WidgetBox.com and is called LiveStockChart. It allows a user to enter a ticker symbol and then displays a small chart from Yahoo. The cool thing about it, however, is that it updates every 30 seconds. You can
visually track the price performance of a stock or ETF all day long (or as long as US markets are open). It also provides a link to the stock's profile at Yahoo Finance.
LiveStockChart's small size allows it to fit into a sidebar and its sticky characteristics may be just what you need to keep your users on your site.
Check out LiveStockChart at WidgetBox.
If you want the code to directly embed in your pages, get the code in a TXT file.
New Widget - Stock News from SeekingAlpha
I have rolled out another widget that will be good for the financial bloggers. It allows the reader to enter a ticker symbol for a stock or ETF and retrieve a list of recent articles from SeekingAlpha.com.
You can find it at WidgetBox at the following URL: NewsFromSeekingAlpha.
Two new widgets available
I have been experimenting with widgets at the WidgetBox.com site and I have created two new ones.
The first one is a small search box that invokes a custom search at Rollyo for News and Current Events. It searches a number of news sites for stories based on the search term you entered. It's called News from Rollyo and you can get it or try it out by clicking on this link which will take you directly to the page at WidgetBox.
The second one provides local traffic alerts and road conditions based on data from Yahoo! You can get it or play with it by clicking this link.
Both of these widgets can be used in the sidebar of your blog or anywhere else you would like to place them.
Labels: search, traffic alerts, Widget, WidgetBox