Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: malfacine on May 29, 2016, 08:26:55 AM

Title: New Plugin - Weather
Post by: malfacine on May 29, 2016, 08:26:55 AM
New Plugin Weather
usage inside of plugin.nut

Works os Windows, Linux and OSX

Extract inside the folder plugins....

Thanks for liquid8 for helping me with file-format module...

https://onedrive.live.com/redir?resid=C85434BAA340DA03!2824&authkey=!AEQekLzhTetnL4g&ithint=file%2czip (https://onedrive.live.com/redir?resid=C85434BAA340DA03!2824&authkey=!AEQekLzhTetnL4g&ithint=file%2czip)
Title: Re: New Plugin - Weather
Post by: kent79 on May 30, 2016, 03:58:25 AM
New Plugin Weather
usage inside of plugin.nut

Works os Windows, Linux and OSX

Extract inside the folder plugins....

Thanks for liquid8 for helping me with file-format module...

https://onedrive.live.com/redir?resid=C85434BAA340DA03!2824&authkey=!AEQekLzhTetnL4g&ithint=file%2czip (https://onedrive.live.com/redir?resid=C85434BAA340DA03!2824&authkey=!AEQekLzhTetnL4g&ithint=file%2czip)

Thank you so much. Could you provide a sample layout to apply the plugin. Thanks
Title: Re: New Plugin - Weather
Post by: malfacine on May 30, 2016, 08:43:24 AM
Code: [Select]
//
 fe.load_module("file-format");
 local xmlSettings = xml.loadFile( FeConfigDirectory + "/plugins/weather/weather_data.xml");
 local query = xmlSettings.getChild("query");
 local results = query.getChild("results");
 local channel = results.getChild("channel");
 local item = channel.getChild("item");
 local condition = item.getChild("yweather:condition");

 fe.add_text(condition.attr["temp"] + "° " + condition.attr["text"], 0, 0, 100, 20 );

example to use
Title: Re: New Plugin - Weather
Post by: kent79 on May 30, 2016, 09:05:06 AM
Code: [Select]
//
 fe.load_module("file-format");
 local xmlSettings = xml.loadFile( FeConfigDirectory + "/plugins/weather/weather_data.xml");
 local query = xmlSettings.getChild("query");
 local results = query.getChild("results");
 local channel = results.getChild("channel");
 local item = channel.getChild("item");
 local condition = item.getChild("yweather:condition");

 fe.add_text(condition.attr["temp"] + "° " + condition.attr["text"], 0, 0, 100, 20 );

example to use

Where to get weather_data.xml file?
Title: Re: New Plugin - Weather
Post by: malfacine on May 30, 2016, 10:21:12 AM
Code: [Select]
//
 fe.load_module("file-format");
 local xmlSettings = xml.loadFile( FeConfigDirectory + "/plugins/weather/weather_data.xml");
 local query = xmlSettings.getChild("query");
 local results = query.getChild("results");
 local channel = results.getChild("channel");
 local item = channel.getChild("item");
 local condition = item.getChild("yweather:condition");

 fe.add_text(condition.attr["temp"] + "° " + condition.attr["text"], 0, 0, 100, 20 );

example to use

Where to get weather_data.xml file?

the plugin generate the data file...

install on plugins path, active plugin and configure with your code city
incorporate code on your layout
Title: Re: New Plugin - Weather
Post by: Mayki07 on May 30, 2016, 02:51:21 PM
It works perfectly. Thank you.  ;)
How to set text RGB for the weather?
Somehow go see icons for the weather?

(http://images.all-free-download.com/images/graphicthumb/various_weather_icon_vector_set_529166.jpg)
Title: Re: New Plugin - Weather
Post by: kent79 on May 30, 2016, 02:57:32 PM
It works perfectly. Thank you.  ;)
How to set text RGB for the weather?
Somehow go see icons for the weather?

(http://images.all-free-download.com/images/graphicthumb/various_weather_icon_vector_set_529166.jpg)

I am still not working. Could you provide theme's code to me for testing?  Thanks  :)
Title: Re: New Plugin - Weather
Post by: malfacine on May 30, 2016, 03:26:37 PM
It works perfectly. Thank you.  ;)
How to set text RGB for the weather?
Somehow go see icons for the weather?

(http://images.all-free-download.com/images/graphicthumb/various_weather_icon_vector_set_529166.jpg)

I am still not working. Could you provide theme's code to me for testing?  Thanks  :)

What is your operating system?
Title: Re: New Plugin - Weather
Post by: kent79 on May 30, 2016, 07:02:45 PM
Windows 10 x64  :)
Title: Re: New Plugin - Weather
Post by: Mayki07 on May 31, 2016, 02:14:21 PM
Weather works in Windows 10, but does not work on my Raspberry Pi Floobs image... >:(
Title: Re: New Plugin - Weather
Post by: malfacine on May 31, 2016, 03:22:48 PM
I do not test on Linux-like systems, the logic should work because the "wget" is universal in linux ...
I will test it on a virtual machine with linux...

need feedback of users to improve....
Title: Re: New Plugin - Weather
Post by: kent79 on May 31, 2016, 11:12:31 PM
I am still not working. No anything show on screen after I put the code. Could you provide basic theme with sample code for testing. Thanks.  :)
Title: Re: New Plugin - Weather
Post by: xbs on June 01, 2016, 07:00:23 AM
Working here (XP) and available on  Simulacra layout.

Is it possible to add location?
e.g. Lisbon, 24° Sunny
Title: Re: New Plugin - Weather
Post by: kent79 on June 01, 2016, 07:25:11 AM
Working here (XP) and available on  Simulacra layout.

Is it possible to add location?
e.g. Lisbon, 24° Sunny

xbs, could you upload your Simulacra's theme nut file for me ? Thanks
Title: Re: New Plugin - Weather
Post by: xbs on June 01, 2016, 08:38:43 AM
It's on the layout thread.
Title: Re: New Plugin - Weather
Post by: malfacine on June 01, 2016, 03:07:37 PM
I am still not working. No anything show on screen after I put the code. Could you provide basic theme with sample code for testing. Thanks.  :)

look for attchments...
Title: Re: New Plugin - Weather
Post by: gunthermic on December 12, 2018, 12:37:13 AM
Did this one ever get solved/working on a PI?

I tried and it doesn't work.

enabled Weather
Loaded the layout.nut into a new theme.