modifying weather widget source

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hello, I have forked the weather widget code on Github from https://github.com/Rise-Vision/widget-weather

Is that the correct source code with which to start?
(By the way, I'm looking to hook up a weather source API from forecast.io)

I've done 

    npm install
    bower install
    gulp build
    gulp test

and everything seems right.
 
Am I supposed to be able to test this with the widget preview tool?
The settings page previews correctly.
But there seem to be three other pages in place of a singe widget page:
     -- three-day    -current    --current-and-three-day

If the widget preview tool is useful, how do I set it up?
Thanks!

 
Photo of Oliver Jones

Oliver Jones

  • 692 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
Hello again Oliver.

Yes, that is the correct source code. The reason you see 3 different Widget HTML files is because these correspond to various layouts that can be used. In the settings, you'll notice you can select one of these 3 layouts or provide the URL to a custom file. The URL to whichever HTML file is selected is what will be saved in the settings.

For the Widget Tester tool, as soon as you save the settings, the Widget URL/file field will be populated with the URL of the layout you selected. This is a minor annoyance when developing, since it will point to a file on our web server and not your local version. So you'll have to replace this URL by selecting your local file. After that, you should be able to preview as normal.

Thx.
Photo of Oliver Jones

Oliver Jones

  • 692 Points 500 badge 2x thumb
Thanks, Donna!
Photo of James Allen

James Allen

  • 182 Points 100 badge 2x thumb

Donna, is there a possibility to change the CNN News Ticker to a locally sourced RSS feed?

Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
James, I'm not sure what you mean by CNN News Ticker? The Weather Widget uses weather data from Tinbu.
Photo of James Allen

James Allen

  • 182 Points 100 badge 2x thumb
On the widget I see a news ticker at the bottom?
(Edited)
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
James,

What you're looking at is the Weather Template, not a Weather Widget. This is a presentation that was created some time ago for users to modify according to their own needs, or keep as default. The CNN News Ticker at the bottom is provided through the Headline News Gadget, and there is no way to modify it's source.
Photo of Daniel Mulder

Daniel Mulder

  • 62 Points
Is there an answer for James' question about the location of the line:

this.hostURL = "https://s3.amazonaws.com/Widget-Weather/";

in the weather.js file?  I have looked and couldn't find it.
(Edited)
Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
Daniel,

That line is only applicable in the Gadget. The Widget does not have this line. If you want to create a custom layout, all you need to do is enter the URL of your layout HTMIL file in the Layout URL field of the Widget's settings.

Thx.