SOS

Shane O'Sullivan's technical blog… really ties the room together

Archive for the ‘json’ Category

Flickr Mundo for Palm webOS

Posted by Shane O'Sullivan on September 5, 2010

I am very happy to announce the release of Flickr Mundo, a fully featured Flickr app for Palm webOS devices.  It is packed full of pretty much everything that a Flickr addict could possibly want, including:

  • Photo upload and download, with multiple simultaneous supported for both.
  • Read & add comments to photos and photo sets
  • Add/remove favourites
  • Bulk editing, e.g. choose 6 photos and add tags to them all in one go, add/remove them from a set or group, add/remove person tags…. and much more.
  • A great browsing experience, jump from one user to another,  open photo sets, groups and galleries.  Swipe from photo to photo.
  • Auto rotated wallpapers.   All the functionality from my other app Flickr Addict is included in Flickr Mundo.  Automatically download images in the background based on many different criteria and change the phone wallpaper on a schedule chosen by you.  No more boring backgrounds!
  • Context sensitive ‘Just Type’ search.  Wherever you are in the app, either hit the search icon or just start typing to search Flickr.  If you’re looking at a user, you can choose to just search that user. If looking at a photo group, you can search just that group.
  • Group search, find a photo group.
  • Location based search.  Find photos near you using GPS, or search for photos close to anywhere else you name.
  • Fullscreen slideshows with an optional audio playlist for playing music while watching your photos.

and much, much more, all wrapped in a highly polished UI that maximises the space of a small screen to the best effect.

A special thank you goes out to Jake and all the guys on the Palm Pre group on Flickr who did huge amounts of user testing on the beta version of the app. They spotted many obscure bugs, and made many suggestions for features and tweaks, most of which have ended up in the app.  Without them Flickr Mundo wouldn’t be anywhere near as complete, functional and fun as it is.

Flickr Mundo will be submitted to the Palm App Catalog in the next 24 hours, and should be available to everyone as soon as Palm approves it!

Update: Flickr Mundo has now been submitted to the App Catalog

Posted in Ajax, Flickr, Flickr Addict, Flickr Mundo, Javascript, json, mobile, Palm, Technical, wallpaper, WebOS | 62 Comments »

Use YQL to cache your queries

Posted by Shane O'Sullivan on August 5, 2010

Quick tip: For faster access to remote data, you can’t beat using Yahoo’s YQL to cache your data.  See HERE to read more on this.

When accessing data from remote services, e.g. Flickr, often the data won’t change too frequently.  Some data can also be very expensive to generate, and services forbid you from polling it on a regular basis.  For example, a device is not allowed to retrieve the latest activity on a users Flickr account more than once per hour.

You could roll your own solution to this problem, store the data locally and check its timestamp.  However, this is a lot of work for something that can be so much simpler.

Simply access the XML or JSON data using the Yahoo Query Language, and set the _maxage parameter to the length of time you want to cache the data for.  And you’re done.  Yahoo will cache the data for you, refresh it when the specified time elapses, and serve it to you faster than the original query since it doesn’t have to calculate anything.

Also, the service provider will be happier as you’re not hitting their server so often for duplicate data.

Posted in Ajax, Flickr, Javascript, json, mobile, Technical | Leave a Comment »

Using Yahoo Query Language (YQL) to count XML elements

Posted by Shane O'Sullivan on April 19, 2010

A quick little YQL tip. I recently had the need to count the number of items in an RSS feed, but without downloading the feed itself as the application is bandwidth sensitive.  So I figured I’d use the Yahoo Query Language, which lets you define SQL queries for accessing all kinds of public data on the web, including of course RSS and Atom feeds.

However it’s implementation of the SQL count() function seems to be buggy, as you can’t simply do

select count(*) from xml where url=”http://path/To/Rss.xml” and and itemPath=”/rss/channel/item”

as it throws and error.  Putting “item” in the count() doesn’t work either.  However, if you try to select the text inside an element, it just returns a single text value, but you still get the count of rows returned, e.g.

select * from xml where url=”http://path/To/Rss.xml” and itemPath=”/rss/channel/item/title/text()”

returns JSON that looks like

cbfunc({
 "query": {
  "count": "233",
  "created": "2010-04-19T10:50:42Z",
  "lang": "en-US",
  "results": "5 stars by Anonymous on February 26, 2010"
 }
});

meaning you save a huge amount of bandwidth but still can get the count of the items in the RSS stream. Check out an example HERE, just press the Test button. Cool huh?

Posted in Ajax, Javascript, json, yql | 3 Comments »

My webOS Apps goes live, gets a big update

Posted by Shane O'Sullivan on March 14, 2010

My webOS Apps, the great tool I’ve written for webOS developers, is now available in the Palm App Catalog.  See my previous post about it here.

Using My webOS Apps a developer for webOS can

  • Keep track of their app download count.  That’s the real download count, not the inaccurate number shown in the Palm feeds which include updates.  You can also see how many apps were downloaded both today and this month, as well as your average download count and your best days download count for each app.
  • See each apps user ratings
  • Read the comments on each app
  • See your downloads for each app in graph form.  Three chart types are supported, line, column and area.  You can graph the downloads per day, by week or month.
  • View a timeline of events for one app or all apps.  This shows what happened to an app by date, from submission through to being accepted and published.
  • Tweet about your apps directly from the app.
  • Auto-Tweet when an app is published.  Set up a custom message to be tweeted automatically when an app is published.
  • Read your forum posts on developer.palm.com.
  • Read the latest forum posts on developer.palm.com.
  • See your financial reports per month, showing how much you’ve earned per month.
  • Backup and restore your data.  As many webOS developers wipe their phone on a regular basis to test different webOS releases, this makes sure you never lose any data.

See the video below for a run through of the app.  For a webOS developer, this is an invaluable tool.  Once you start using it, you’ll wonder how you ever did without it!

Posted in Ajax, chart, Dojo, dojo.charting, dojox.gfx, Javascript, json, Palm, WebOS | Leave a Comment »

More Offline Goodness With Dojo

Posted by Shane O'Sullivan on September 23, 2008

Kris Zyp from SitePen has posted an article about the Dojo Ajax Toolkit‘s latest addition to it’s Offline Web capabilities, OfflineRest. Check it out at http://www.sitepen.com/blog/2008/09/23/effortless-offline-with-offlinerest.

The idea is brilliant – if you send your data to the user using the JsonRestStore, you can now add an amazingly simple offline capabilty to your website with two lines of code (more or less).

This rocks.

There’s also an interview with Kris over at Ajaxian – http://ajaxian.com/archives/audible-ajax-episode-30-interview-with-kris-zyp

Posted in Ajax, Dojo, dojo.data, dojox.data, json, offline, open source | Leave a Comment »

Chofter.com – A Next-Gen Search Portal is launched

Posted by Shane O'Sullivan on August 4, 2008

For quite a while, I had been working with various REST services, e.g. Flickr, the Google search services and more, as part of my contributions to the Dojo Ajax Toolkit, when it occurred to me that no one had done a good job of bringing all these various sources of information together in a usable way.

Cut to four months later, and I have launched my new search portal, Chofter.com.

To add it to the search bar in your browser, click here.

Immodest as it may sound, Chofter.com provides a better search experience than Google, Yahoo or Microsoft Live, because it incorporates search results from all of them, and much more.

The entire application is written using the Dojo toolkit, utilising

  • Layouts, Dialogs, Menus and ContentPanes for the user interface.
  • dojo.data and dojo.rpc for data transfer.
  • dojox.dtl (Django Templating Library) for transforming search data into visuals.
  • dojo.fx and FisheyeLite for eye candy
  • …. and a chunk of custom code.

As of writing, the following search sources are available, arranged into a number of categories:

  • Google – web, news, image, blog, video and book search.
  • Yahoo – web, news and image search.
  • Microsoft Live – web and news search.
  • YouTube – video search.
  • Flickr – image search.
  • BBC News – news and sports search.
  • Digg – web, news and video search.
  • Amazon.com – book search.
  • Wikipedia – web search.
  • IMDB – video search.
  • Technorati – blog search.
  • DZone – technical search.

I will be adding more as time goes on.  A forum is being set up, and I welcome all feedback on the site.  I’ve also set up a blog for the site at http://www.chofter.com/blog.

Posted in chofter, dijit, Dojo, dojo.data, dojox, dojox.data, Javascript, json, search, Technical | 4 Comments »

Keep up with the latest Dojo Demos

Posted by Shane O'Sullivan on May 8, 2008

The Dojo Feature Explorer now has an Atom feed you can subscribe to to keep up with all the latest demos that have been added.  So, point your browser at http://dojocampus.org/explorer/featureexplorer/latestDemos.xml and subscribe!

For all the Web 2.0 addicts out there, I’ve also added access to the list via SCRIPT IO.  If you point your browser to http://dojocampus.org/explorer/featureexplorer/latestDemos.php, you will receive a file containing a JavaScript array of the last ten demos added to the feature explorer.  By default, it will call the function dojocDemos, passing it the array.  You can specify the callback function you want using the callback parameter. e.g.

http://dojocampus.org/explorer/featureexplorer/latestDemos.php?callback=myFunction

will call the myFunction JavaScript function.  You can load this file, as I mentioned, using SCRIPT IO.  This could be hard coded into your HTML page, e.g.:

<script type=”text/javascript” src=”http://dojocampus.org/explorer/featureexplorer/latestDemos/php?callback=myFunction”></script&gt;

or loaded using dojo.io.script.

Posted in Ajax, Atom, Dojo, Javascript, json, open source, Technical | Leave a Comment »

Google and Dojo, F.E.E.D.I.N.G

Posted by Shane O'Sullivan on May 6, 2008

This is the second in series of posts on the work I’m doing to bring the Google Ajax APIs and Dojo Ajax Toolkit together. The first post was Google And Dojo, Sitting in a Tree, which you can read for some background.

I have submitted a new data store to the DojoX project, dojox.data.GoogleFeedStore, which makes it possible to access any RSS or Atom feed, anywhere, directly from your own web page. Simply pass the URL of the feed to the GoogleFeedStore, and it will return it to you using the dojo.data.Read API.

Example

var store = new dojox.data.GoogleFeedStore();
store.fetch({
  query:{url:"http://shaneosullivan.wordpress.com/feed/"},
  onComplete: function(items) {
    dojo.forEach(items, "alert('Got feed entry with title ' + this.getValue(item, 'title'))", store);
  },
  count: 10
});

This will retrieve the first 10 entries in my blogs feed, and alert the title of each.

The huge advantage of this is that you no longer need any server side redirects to access RSS and Atom feeds from your own website. This Google service is the basis for Google Reader and iGoogle.

If you want to access an Atom feed from your own web server, you can also use the dojox.data.AtomReadStore that I wrote earlier. However, this is only useful if you have direct access to the Atom XML document using Ajax, and due to browser security issues, you can only load these documents from the web server hosting the web page. This new GoogleFeedStore removes that restriction, and has the added advantage that it also works with RSS.

Check out the demo page to get a feel for it (available in the May 6th nightlies), and there should be an example up on the Dojo Feature Explorer quite soon too.

As before, a big thanks to Google for providing such a cool service.

Posted in Ajax, Dojo, dojo.data, dojox, dojox.data, Feeds, Google, Javascript, json, open source, Technical | Tagged: | 6 Comments »

Google and Dojo, Sitting in a tree…

Posted by Shane O'Sullivan on May 1, 2008

I’ve submitted a bunch of new data stores to the Dojo Ajax Toolkit that make it simple to search Google directly from your own site (ticket here).

Update: I’ve also submitted a store to read any Atom or RSS feed, anywhere, without any server redirects. See Google And Dojo, F.E.E.D.I.N.G

This is different from putting a search box on your site and redirecting to Google. With the new dojox.data.GoogleSearchStore family of data stores, you can retrieve google search results in JSON format, and display them on your site directly.

Pause a second…. let it sink in…..

There are no cross domain issues, and no server side component is required. It uses the dojo.io.script transport to access the Google Ajax API service. Just stick the following on your page:

<div dojoType=”dojox.data.GoogleWebSearchStore” jsID=”googleStore”></div>

and you have Google’s millions of servers at your fingertips.

The following data stores are available:

  • GoogleWebSearchStore - does a standard web search.
  • GoogleBlogSearchStore - searches blogs. A future enhancement I will be writing will be to write a data store that accesses Google’s extremely cool Ajax Feed API, which provides access to any ATOM feed, anywhere, in JSON. It’ll be possible to do a full web search of all blogs for certain topics, then using the feed store to pull down that complete feed .
  • GoogleLocalSearchStore - searches the Google Local service to find places, businesses etc.
  • GoogleVideoSearchStore - Does what it says on the tin, searches for videos.
  • GoogleNewsSearchStore - Finds news stories…. noticing a pattern yet?
  • GoogleBookSearchStore - Um, finds books..
  • GoogleImageSearchStore - Finds images. This provides both a thumbnail and full sized version, similar to the FlickrRestStore already provided by Dojo.

The potential applications are more or less infinite. Demos included in the check-in show how to integrate this with the extremely cool dojox.dtl templating engine to display the results in a number of different ways, as well as how to feed the results into the Dojo Grid, Gallery and SlideShow.

This code is included in the nightly checkouts of Dojo, and not in v1.1. To get it, either check it out from source control, or get it from http://archive.dojotoolkit.org/nightly/.

Have a look at the simplistic demo of it in action at http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/data/demos/demo_GoogleSearchStore.html (available from the May 1st nightlies).

A big thank you to Google for making this service available. Now go play!

P.S. Stay tuned for the Yahoo variant, coming soon!

Posted in Ajax, Atom, Dojo, dojo.data, dojox, Javascript, json, open source, Technical | Tagged: | 11 Comments »

Dojo Ajax Demo Engine released

Posted by Shane O'Sullivan on April 3, 2008

A great new demo engine has just been released for the Dojo Toolkit. Check it out at http://dojocampus.org/explorer/. It is based on the initial attempt at a demo engine I wrote a few months ago, but has since been updated with new demos, and made infinitely more sexy by css/theme master Nikolai Onken.

Dojo Demo Engine

The features include:

  • Demos for all three Dojo projects – Dojo (the base toolkit), Dijit (widgets) and DojoX (all that is newest and coolest) .
  • Source views for all demos. Not only do we show what Dojo can do, we show you how to do it! The source views also benefit from the very cool dojox.highlight project, which provides client side syntax highlighting.
  • Addressability - you can link directly to a demo, as I did with the dojox.highlight link above.
  • Search feature – a combo box that you can use to quickly find a demo on any subject. For example, type “image” into the box, and you’ll be shown a list of all demos to do with displaying images, such as dojox.image.Gallery, dojox.image.SlideShow etc.
  • Cool animated menus – totally aesthetic I know, but a very pretty addition by Peter Higgins. The menus separate the three projects, providing easier, clearer navigation.
  • Link hierarchies – each set of demos can have links attached to it, for example to extra tutorials or documentation. If you click a parent of that demo, you are shown all links of all children of that section. For example, click on the DojoX link on the top of the page, and you’ll be presented with a list of all links to all DojoX projects.
  • Browser Back Button management. Using the dojo.back package, you can navigate back and forward through the application using the browser’s back and forward buttons.

The demo engine is hosted on the extremely cool Dojo Campus website, which is a new learning resource for all things Dojo. It contains videos, tutorials and much more.

This version of the demo engine has many many examples in it. However, it is only the beginning, and there is a lot of room to add more content. The next step is to open the development process for community submissions of all the cool things people have done with Dojo. We will be making available the demo engine on Subversion, and writing development and submission processes to make it as easy as possible for people to contribute.

This is gonna be big!

Update: see http://ajaxian.com/archives/dojo-mini-and-the-feature-explorer for the Ajaxian post.
Share this post:digg it|kick it|Email it|bookmark it|reddit|liveIt

Posted in Ajax, demo, Demo Engine, dijit, django, Dojo, dojo.charting, dojo.data, dojo.event, dojo.image, dojo.query, dojox, dojox.data, dojox.image, Image Gallery, Javascript, json, open source, Technical | 16 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 535 other followers

%d bloggers like this: