Tuesday, May 8, 2012

jQuery and jQueryUI links for Google and Microsoft CDN's

The Google Libraries API and Microsoft Ajax Content Delivery Network (CDN) hosts the popular jQuery library and enables you to easily add them to your Web applications. For example, you can start using jQuery which is hosted on this CDN simply by adding a <script> tag to your page that points to a CDN link. These CDN's are very efficient and reliable as they have more replications to reduce latency. Browsers limit the number of concurrent connections (file downloads) to a single domain so using CDN's triggers parallel downloads leading to faster page loading. Here are some reasons to USE and NOT USE the CDN networks.

The versions of jQuery keeps getting updated every now and then and it's difficult to keep track of the latest releases. For that reason I've created a page that automatically pulls in the latest versions and links for the jQuery, jQueryUI and jQueryUI Theme libraries for both Google and Microsoft CDN's. Keep it bookmarked to stay up-to-date on jQuery releases.


Sunday, February 26, 2012

Weather Geocoder with Google Maps and Google Weather API

Google Weather GeocoderI got tired of searching locations on weather reporting websites to get instant updates, so I thought of building an instant weather reporting application which would give me information for any location I click on the map. Google Maps API provides an inbuilt reverse-geocoding service which can geocode an IP Address to a place on the map. To get weather information, I’ve used the so called secret Weather API from Google which they use on the iGoogle page widget. Google has not officially published this API but we would love if they do so. The good thing about Google’s weather API is that it is easy to use and includes the weather icons, but there is no way as of now to get the data in other formats apart from XML:

Demo on my Labs page: http://lab.abhinayrathore.com/geocode_weather/

You can play around with the app on my labs page and view the source on the page to get the JavaScript code to build this tool on your own website. To convert the XML data from Google Weather API to JSONP, I’ve written a small PHP script you can download from the link below.

Click here to get the PHP Script for converting Google Weather API’s XML data to JSON/JSONP format.

You can style the Weather Information window according to your needs or you can use the one I’ve created: http://lab.abhinayrathore.com/geocode_weather/weather.css. You can freely modify the JavaScript code to suit your needs. If you find any bugs or see improvement opportunities, please do drop a comment below and I’ll look into it asap :)