Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Request.ForecastWeather is a simple class MooTools that extends Request.JSONP and display the local forecast weather on your website, blog or other web document.

tree: 4a5c2081bf

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Request.ForecastWeather

This is a simple plugin that shows you the local weather with JSONP&YQL-driven badge.

Screenshot

How to use

First you must to include the JS files in the head of your HTML document.

   #HTML
   <script type="text/javascript" src="core.js"></script>
   <script type="text/javascript" src="jsonp.js"></script>
   <script type="text/javascript" src="Request.ForecastWeather.js"></script>

In your JavaScript source:

   #JS 
   window.addEvent('domready',function(){ 
       new Request.ForecastWeather('bucharest','c',{
                   onSuccess: function(o){
                          var title = '<p style="color: blue"><strong>'+o.query.results.weather.rss.channel.item.title+'</strong></p>',
                              description = o.query.results.weather.rss.channel.item.description;               
                              $('weatherbadge').set('html',title+description);
                   }
       }).send();

     //You can load the weather in an Element 
     $('custom').loadWeather('london','f');
  });

In your HTML source:

   #HTML
   <div id="weatherbadge"></div>
   <div id="custom"></div>

Dependencies

  MooTools Core 1.3
  MooTools More: Request.JSONP
Something went wrong with that request. Please try again.