Request.ForecastWeather v1.3

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



Details

Author
Adrian Statescu
Current version
v1.3
GitHub
thinkphp/Request.ForecastWeather
Downloads
4678
Category
Widgets
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.3: *
  • more/1.3.0.1: Request.JSONP

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

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus