Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function (){
  2.     var root = 'http://api.openweathermap.org';
  3.    
  4.     $.ajax({
  5.         type: 'GET',
  6.         url: root + '/data/2.5/weather?q=plovdiv&appid=db50e8e2dfc0f5e4e4c98d1f473bef57',
  7.         success: function(weather) {
  8.            
  9.            
  10.             console.log(weather);
  11.             console.log('Weather in ' + weather.name + ', ' + weather.sys.country);    
  12.             console.log(weather.weather[0].description);
  13.        
  14.  
  15.             console.log('_______________________________________________________');
  16.            
  17.             console.log('Wind: ' + weather.wind.speed);
  18.             console.log('Cloudiness : ' + weather.weather[0].description);
  19.             console.log('Pressure : ' + weather.main.pressure + ' hpa');
  20.             console.log('Humidity : ' + weather.main.humidity + '%');
  21.             console.log('Sunrise : ' + weather.sys.sunrise);
  22.             console.log('Sunset : ' + weather.sys.sunset);
  23.             console.log('Geo coords : [' + weather.coord.lat + ',' + weather.coord.lon + ']');     
  24.            
  25.            
  26.            
  27.         }
  28.     });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement