function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KillerRamana KumarKillerRamana Kumar 

Personalization Dynamic Current Weather Widget

Hi Friends, Thanks in advance!

I want to create a Dynamic Current Weather Widget based on user Address.I have tried wunderground.com API & 'http://www.wunderground.com/weather/api/d/docs?d=resources/code-samples&MR=1 (http://www.wunderground.com/weather/api/d/docs?d=resources/code-samples&MR=1)' some other API's I have used But Iam unable to configure.I want the screen as like this

I want similar ti like this
(Or)

I want similar ti like this
KaranrajKaranraj
Check this blog post for the sample code using Weather Under Ground API https://developer.salesforce.com/blogs/developer-relations/2015/06/creating-lightning-weather-component.html using salesforce lighning components.

Thanks,
Karanraj
KillerRamana KumarKillerRamana Kumar
Thanks Karanraj for your Assistance, I Dont want to use any external app.

I want get it by using Developer API. To fetch Weather Forecast i have used following code

<apex:page standardController="Account">
  <h3>Current Weather</h3>
  <div id="current-weather"></div>
 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  <script>
    jQuery(document).ready(function($) {
      $.ajax({
      url : "http://api.wunderground.com/api/a0acd71c9fdb4095/conditions/q/CA/San_Francisco.json",
      dataType : "jsonp",
      success : function(parsed_json) {
        var location = parsed_json['location']['city'];
        var temp_f = parsed_json['current_observation']['temp_f'];
        $("#current-weather").text("Current temperature in " + location + " is " + temp_f);
      }
    });
  });
  </script>
</apex:page>

-----

Using developer API i have created.

API: http://api.wunderground.com/api/a0acd71c9fdb4095/conditions/q/CA/San_Francisco.json

For country - {!user.country} . where can i add user name, State etc..in this url.