View unanswered posts | View active topics It is currently Thu May 23, 2013 6:51 am



Reply to topic  [ 58 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
 Weather remake 
Author Message

Joined: Sat Feb 13, 2010 9:59 pm
Posts: 673
Location: Tilburg
Post Weather remake
Hello guys,

This topic is dedicated to improving Weather component. It's look-and-feel effect is not so bad, but we know it can be better! Moreover, it hasn't been updated for a long time, so you can see some 'ims_weather_*' messages on weather page.

The main concept is quite simple: make it like you want it. You will have to spend a little bit of time for configuration (I'll write later on how to do it), which in fact is not so difficult. If you mess something up, in the worst case you can't use Weather feeds anymore - so don't worry about your movies.

If you are a lazy person and always waiting for ready-to-go solution - please DON'T read this topic. Otherwise, everyone is invited in participating! I'm sure you'll have a great satisfaction when you finish your one and only Weather page.

Remember: as there's no official documentation of RSS commands and I don't work for ACR/Realtek/any_other_related_company, I don't know everything but I'll try to help as much as I can. Anyway, let's get started:

1) Open http://weather.yahoo.com, search or browse to your city and notice address bar. I live in Tilburg, so I get this link:
Quote:
http://weather.yahoo.com/netherlands/north-brabant/tilburg-733881/

The number you can see is so-called WOEID, we'll need it later as a parameter 'w' in RSS feed.


2) Download images (78 KB) and put them in correct folder:
Quote:
mount -o,remount,rw / && cd /usr/local/bin/IMS_Modules/Weather/image/ && wget http://stg.unixstorm.org/playon/weather_images.zip && unzip -o weather_images.zip && rm -f weather_images.zip && mount -o,remount,r /


3) Download and edit myfavorites.rss file (14 KB):
Quote:
mount -o,remount,rw / && cd /usr/local/bin/IMS_Modules/Weather/scripts/map/ && rm -f myfavorites.rss && wget http://stg.unixstorm.org/playon/myfavorites.rss && chmod +x myfavorites.rss && mount -o,remount,r /



There's a lot of things to change, but I'll start from the basics:
At the beginning of <background> section you will find:
Quote:
loadXMLFile("http://weather.yahooapis.com/forecastrss?w=733881&amp;u=c&amp;d=5");


Change 733881 to number from Step 1. If you are not going to use 5-day weather forecast, remove &amp;d=5 part. If you are using Fahrenheit temperature scale (instead of Celsius), just change u=c to u=f. You should also change displayed text, from " &#176;C" to " &#176;F".

I'm not a graphic designer, therefore it's more concentrated on usability, instead of graphic effects. Maybe someone talented can make nice theme and share it with everyone? Please consider it as a base script for further modifications. Anyway, go to Internet feeds and enter Weather. You should see this:

Image


Now press Enter key one more time and you should see something like that:

Image


Thu May 27, 2010 7:57 pm
Profile

Joined: Thu Mar 04, 2010 2:30 pm
Posts: 148
Post Re: Weather remake
Thank. :grinning:

Here is my new weather screen.
Image


Thu May 27, 2010 9:29 pm
Profile

Joined: Sat Feb 13, 2010 9:59 pm
Posts: 673
Location: Tilburg
Post Re: Weather remake
Looks great OoD!


Thu May 27, 2010 9:33 pm
Profile

Joined: Sat May 08, 2010 5:07 am
Posts: 335
Post Re: Weather remake
That is absolutely cool; being in Canada the standard PlayonHD weather feed was useless to me since Canada was not included. Thank to your inventiveness now I can have the local weather on the PlayonHD.

I would just like to add that if you have already installed metafeeds on your PlayonHD the weather feed tab is no longer available; not sure why it was removed. Anyhow to fix the problem you will have to edit your menu.rss file located in the /tmp/hdd/root/rss_script/ and add the following between the end of a previously entered </item> and the start of a new one <item>; just look at the file and I think you will understand what I mean. Do not enter the asterisk on line 6 see note below.

Code:
<item>
<title>Weather</title>
<link>rss_file://./IMS_Modules/Weather/scripts/map/myfavorites.rss</link>
<media:thumbnail  width="120" height="90" >
    <script>
     if (getQueryItemIndex() == 3)    ************** See Note ************
     {
          state=getDrawingItemState();
          if( state == "focus" ){
            "./IMS_Modules/Weather/image/weather_focus_en.jpg";
          }
          else{
            "./IMS_Modules/Weather/image/weather_unfocus_en.jpg";
            }
      }
    </script>
 </media:thumbnail>
</item>



*****note: The number after the == sign represent the order of the index (where the graphic link is located on your feed menu) as long as none of the index are the same you should be ok. The index start at 0 and continue on until you reach your last item. I am not sure if they have to be in order in the menu.rss xml file but in my case it is. For example I prefer to have the weather as my forth item in the feed list so itemindex = 3; remember we start at 0. You can just use vi text editor to make the changes and copy/paste the code into the menu.rss file. Remember to delete the asterisk and properly index your items or else you will get an error when you try to open the feed menu.

Great add on; now I have to find a beautiful background that represent my area well.

Thanks again mikka for this. I am becoming a fan of your work.


Fri May 28, 2010 5:16 am
Profile

Joined: Sat Feb 13, 2010 9:59 pm
Posts: 673
Location: Tilburg
Post Re: Weather remake
OoD: is it possible to use your fantastic theme?


snappy46 wrote:
I would just like to add that if you have already installed metafeeds on your PlayonHD the weather feed tab is no longer available; not sure why it was removed. Anyhow to fix the problem you will have to edit your menu.rss file located in the /tmp/hdd/root/rss_script/ and add the following between the end of a previously entered </item> and the start of a new one <item>; just look at the file and I think you will understand what I mean. Do not enter the asterisk on line 6 see note below.


Thanks for the how-to! Weather is not available after installing Metafeeds, because main menu of Internet Feeds doesn't support horizontal scrolling, so in reality there's space for about 5 feeds (with fresh firmware you already have 4). Metafeeds is using 2 (main + Favorites), so it overwrites menu position of Weather.

I'm not yet satisfied with this Weather, mainly because it requires 2-times pressing Enter (one time is enough). There's no RSS documentation, so development is being done with a try-and-look-what-has-been-changed method. I reckon it as a good base for further improvements.

For example, you may want to remove information which you don't need. So if you don't care about wind speed (or something else), you can just delete lines:
Code:
windSpeed=getXMLAttribute("rss","channel","yweather:wind","speed");

and
Code:
<text offsetXPC=8 offsetYPC=40 widthPC=14 heightPC=5 fontSize=22 foregroundColor=255:255:255>
<script_replace> print("Wind:"); </script_replace>
</text>

and
Code:
<text offsetXPC=27 offsetYPC=40 widthPC=12 heightPC=5 fontSize=22 foregroundColor=255:255:255>
<script_replace> print(windSpeed + " km/h"); </script_replace>
</text>



If you want to check weather status for more cities, you might want to do loadxml for 1st city, save it's data by using getXMLAttribute, then do another loadxml with 2nd city as parameter - that way you can show info even for 3 or more cities on single page. In case you have uncle in Australia and aunt in France (if cities are located in different countries), you can put each together with it's country flag.

In <mediaDisplay> section you may want to change:
Quote:
backgroundColor="0:0:0"

to a different color values (described as RGB).

In <background> section, <image> elements have parameters:
- offsetXPC: starting X position of image
- offsetYPC: starting Y position of image
- widthPC: percentage width of image (in relation to screen width: 0-100)
- heightPC: percentage height of image (in relation to screen height: 0-100)
between <image></image> tag goes local or remote link to image which has to be displayed.

<text> elements have parameters:
- offsetXPC: starting X position of text
- offsetYPC: starting Y position of text
- widthPC: percentage width of text (in relation to screen width: 0-100)
- heightPC: percentage height of text (in relation to screen height: 0-100)
- fontSize: size of text font
- backgroundColor: background color of text field
- foregroundColor: text color
between <text></text> tag goes text which has to be displayed.


Fri May 28, 2010 4:31 pm
Profile

Joined: Sat May 08, 2010 5:07 am
Posts: 335
Post Re: Weather remake
mikka wrote:

Thanks for the how-to! Weather is not available after installing Metafeeds, because main menu of Internet Feeds doesn't support horizontal scrolling, so in reality there's space for about 5 feeds (with fresh firmware you already have 4). Metafeeds is using 2 (main + Favorites), so it overwrites menu position of Weather.


This must be firmware specific; horizontal scrolling working fine here on firmware R3643.

mikka wrote:
I'm not yet satisfied with this Weather, mainly because it requires 2-times pressing Enter (one time is enough). There's no RSS documentation, so development is being done with a try-and-look-what-has-been-changed method. I reckon it as a good base for further improvements.


There is always room for improvement but this look pretty darn good to me and I love all the information available.


Fri May 28, 2010 7:55 pm
Profile

Joined: Thu Mar 04, 2010 2:30 pm
Posts: 148
Post Re: Weather remake
i copy block <mediaDisplay> from "myfavorites.rss" to "menu.rss"
it can enter direct to weather page.

i add code to menu.rss like this.
Quote:
<item>
<title>Weather</title>
<link>rss_file://./IMS_Modules/Weather/scripts/map/myfavorites.rss</link>
<media:thumbnail width="120" height="90" >
<script>
if (getQueryItemIndex() == 4)
{
state=getDrawingItemState();
if( state == "focus" ){
"./IMS_Modules/Weather/image/weather_focus_en.jpg";
}
else{
"./IMS_Modules/Weather/image/weather_unfocus_en.jpg";
}
}
</script>
</media:thumbnail>

<mediaDisplay name=weatherViewRss

...
...

</mediaDisplay>

</item>


Fri May 28, 2010 8:13 pm
Profile

Joined: Thu Mar 04, 2010 2:30 pm
Posts: 148
Post Re: Weather remake
mikka wrote:
OoD: is it possible to use your fantastic theme?


What theme? Did you mean this background?
Image


Fri May 28, 2010 8:20 pm
Profile

Joined: Wed Nov 04, 2009 3:17 pm
Posts: 182
Post Re: Weather remake
mikka you are doing a great job lately. :)
Its good to have you onboard. You are the leader of he community since vonck is missing (anyone see him lately???).
Personally I'm not trying to find new things for pohd lately because I lost the motiviation when I realised that request forum is useful, ACR dont implement on official firmwares new features done by users (or they do it too late, i.e metafeeds) and last but not least we dont get too official help neither colaboration from official acr team(we just get it from the mods)...

snappy46 wrote:
mikka wrote:

Thanks for the how-to! Weather is not available after installing Metafeeds, because main menu of Internet Feeds doesn't support horizontal scrolling, so in reality there's space for about 5 feeds (with fresh firmware you already have 4). Metafeeds is using 2 (main + Favorites), so it overwrites menu position of Weather.


This must be firmware specific; horizontal scrolling working fine herhttp://www.acryan.com/forums/posting ... &p=40188#e on firmware R3643.

snappy46 is right. On previous firmware I managed to have a lot of feeds on the main menu so it just must be something that was changed on the menu.rss file. I guess it's as easy as go back to the style of previous menu.rss file. Sorry I'm out of home so I cant compare old and new menu.rss file...

_________________
Check this out! My 9 years old brother rapping: http://www.youtube.com/watch?v=rM0fB3XbTqQ

Stay tuned:
http://twitter.com/titobravo_ngomo[/size]


Sat May 29, 2010 9:21 am
Profile

Joined: Sat Feb 13, 2010 9:59 pm
Posts: 673
Location: Tilburg
Post Re: Weather remake
OoD wrote:
i copy block <mediaDisplay> from "myfavorites.rss" to "menu.rss"
it can enter direct to weather page.


Wow, thanks! This is what I wanted! I'll check it out later and replace links. Can you share background with us?


Sat May 29, 2010 5:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 58 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by: phpBB | Innitial forum Design by: STSoftware | Modified by: AC Ryan.