PDA

View Full Version : Editing your Rss weather feed + Canadians Weather feed



snappy46
09-11-2010, 05:14 PM
Here some rss feeds that I created to give us Canadians and whoever want to know how cold it can be here some weather rss feed that should have been there in the first place. I use some of the most populated areas as well as geographic placement to try to cover as many regions as possible. If there are other location, town, cities that you would like to add to the feed just read below after the installation guide to see how to do it easily.

Now onto the installation:

1) First of all the directory structure for the PBO-IMS and PBryan is different so if you are using the PBO-IMS download those two files:
http://www.megaupload.com/?d=E6ZU2CUJ
http://www.megaupload.com/?d=JFCERYD9

Now if you are using one of those patch AC Ryan firmware (4107 or 4318) then download those two files:
http://www.megaupload.com/?d=E0KNKK42
http://www.megaupload.com/?d=UA5TWGDC

Make sure you download the correct files or things won't work for you.

2) Now you have to get those two file in the proper directory on your PBO or PBRyan. I'll just go through the easiest way I know how. So take those two files you just downloaded and copy them to your HDD1 using your network connection (samba/win network push/pull it does not matter just copy them to the HDD1. Now if you do not have a HDD installed you can use also a USB stick if you want but the command to install will be a little different; I'll explain after the HDD installation.

3) Ok now that you have your file in your HDD1 directory telnet to your PBO and proceed as follow:

For the PBO-IMS firmware:


# mount -o remount,rw /
# cp /tmp/hdd/volumes/HDD1/world.rss /usr/local/bin/scripts/map/
# cp /tmp/hdd/volumes/HDD1/Canada.rss /usr/local/bin/scripts/map/
# mount -o remount,ro /

For the PBRyan (4107, 4318) firmware:


# mount -o remount,rw /
# cp /tmp/hdd/volumes/HDD1/world.rss /usr/local/bin/IMS_Modules/Weather/scripts/
# cp /tmp/hdd/volumes/HDD1/Canada.rss /usr/local/bin/IMS_Modules/Weather/scripts/
# mount -o remount,ro /


If you are using a USB Stick substitute the /tmp/hdd/volumes/HDD1 for /tmp/usbmounts/sdbx/world.rss ....... x would probably be equal to 1 but just check your USB path to make sure.

That's it now Canada rss weather feed will be available to you when you go to the weather rss feed on the PBO /PBRyan. Just so that everyone knows I can only confirm for sure that it works with PBRyan firmware since this is what I have right now. I did change all the directory path in both Canada and world rss feed for the PBO-IMS but if I miss something then you may have weird results. Please just report them back to me and I will fix them and repost the appropriate links.

And here the final warning; although this should not cause any problem for your PBO you are doing this at your own risk and I will not be held responsible.


-------------------------- How to Edit your weather Rss Feed (Non-Canadian weather feed see note below) ---------------------------------

Ok now for the people that do not like my selection of cities and for those that would like to include their own town/city/whatever here's how to proceed:

If you look at the Canada.rss you will see a bunch of element items at the bottom; a whole list that looks like that:


<item>
<title>Toronto</title>
<cur>4118</cur>
<for>Toronto</for>
</item>


You can add as many of those as you would like to see in the feed. So decide which town you would like to add; let say for example Newmarket. Go to the following link: http://sigizmund.info/woeidinfo/ and enter Newmarket ON in the field displayed and enter find. This will give you the WOEID number that you need to enter in your item element of the rss feed. So in our case the code is "4113" so add this code to your Canada.rss:


<item>
<title>Newmarket</title>
<cur>4113</cur>
<for>Newmarket</for>
</item>


Save the Canada.rss file and copy back to proper directory (Procedure explain above) and now you have a new weather for Newmarket available you can also put it at the top of the list if you want it to be the first element feed although it does not matter you can just add it to your favorite and it will be available on the first weather screen.

Enjoy!! and let me know if there are any issues .... I can't fix it if I don't know it's broken.:)

Note: Please note that for people from other country that would like to use this procedure to add cities/town etc ... to their specific country rss feed this will not work for you. The reasons this won't work is because that in the rss feed for Canada that I provided it uses the latest and now only documented yahoo weather api call which uses a new location identifier WOEID, the one currently for the other country rss feed uses the old location identifier XAOP that is no longer documented and although yahoo weather still accept this type of API request it could be drop at any time without any notices. With that being said if you wish to add a location to your weather feed you will have to use the old location identifier. So for all other countries to figure out the code required to add to your country rss feed use this link: http://aspnetresources.com/tools/WeatherIdResolver

This link will provide you with the correct XAOP code to use with your code <cur></cur> item in your rss feed.

aasoror
09-11-2010, 05:46 PM
This thread just got 5 stars from me :)
Thanks snappy.

snappy46
09-13-2010, 12:10 PM
Hi Mod/Patriot Staff,

With all the stuff that I added to my original post the Thread title does not quite match the info available in this thread and the info might be useful to all users but might be overlook by non-Canadians.

Could you please change the title of the thread to something more appropriate like "Editing your Rss weather feed + Canadians Weather feed"

Thank you very much.

wigout
09-13-2010, 12:49 PM
Boy, I missed the forum I was moving this to and ended up in the wrong forum.

WHOLE FORUM MODS: please move this thread back to
Patriot Memory Support Forums > Media Players > Mods/Hacks:
http://www.patriotmemory.com/forums/forumdisplay.php?f=24

sorry for the trouble.

-wigout

snappy46
09-13-2010, 07:48 PM
Thanks wigout; I appreciate all your effort to organize this forum.

py2000
10-18-2010, 11:18 PM
I upgraded my PBO to P61-beta and then found this thread. But it appears that I cannot update the files in /usr/local/bin as it's mounted on / and is 100% full:


/usr/local/bin/scripts/map # df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 22.3M 22.3M 0 100% /
/dev/mtdblock/2 40.0M 1.3M 38.7M 3% /usr/local/etc
/dev/rd/0 40.0k 40.0k 0 100% /mnt/rd

Anyway to work around this limitation using the stock firmware?

snappy46
10-19-2010, 12:14 AM
I upgraded my PBO to P61-beta and then found this thread. But it appears that I cannot update the files in /usr/local/bin as it's mounted on / and is 100% full:


/usr/local/bin/scripts/map # df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 22.3M 22.3M 0 100% /
/dev/mtdblock/2 40.0M 1.3M 38.7M 3% /usr/local/etc
/dev/rd/0 40.0k 40.0k 0 100% /mnt/rd

Anyway to work around this limitation using the stock firmware?

You are probably using the P61 BC18 which uses the squashfs filesystem which is read only. I flash with the P61 (BC16) and add enough room to add the Canada Weather and a few more links to my menu.rss and still have a little bit of room left. If you are in fact using the P61 (BC16) and are out of room you could always delete some of the extra images in the /usr/local/bin/image. Anything pictures dealing with lastFM for example can be deleted to give you some room. I personally did not had to delete anything to install the Canada Weather feed.

Good luck and ask if you need more clarification and let us know which P61 (BC16) or (BC18) you have flash your PBO with.

py2000
10-19-2010, 01:03 AM
BC18... I forgot to mention it.

snappy46
10-19-2010, 02:23 AM
BC18... I forgot to mention it.

The only way to do this is either use P61 BC16 or make changes to the firmware before you flash it to your PBO which can be quite involved depending of your level of expertise. It would mean to untar the install.img (extract content) then unsquash the squash file (actual directory structure) make the changes to the /usr/local/bin/scripts/map by adding the Canada.rss and replacing the world.rss and then squash all the directory back again then tar the whole firmware as an install.img.

Here a little tutorial on how to proceed for another player. This example also uses yaffs filesystem vs the squashfs filesystem so things are a little different but very similar.

http://forums.seagate.com/t5/FreeAgent-Theater/HOWTO-Roll-Your-Own-Firmware/td-p/41570

wigout
10-19-2010, 02:52 AM
And as long as the source was going to stay attached to the player (on the usb drive or the hard drive) they could get away with simply overmounting the:
/usr/local/bin/scripts/map/
/usr/local/bin/IMS_Modules/Weather/scripts/
as the case may be.

to do so:
have your files, world.rss and Canada.rss at the root of your internal harddrive.
telnet in.

cp -a /usr/local/bin/scripts/map/ /tmp/hdd/volumes/HDD1/
mv /tmp/hdd/volumes/HDD1/world.rss /tmp/hdd/volumes/HDD1/map/
mv /tmp/hdd/volumes/HDD1/Canada.rss /tmp/hdd/volumes/HDD1/map
mount -o bind /tmp/hdd/volumes/HDD1/map/ /usr/local/bin/scripts/map/
And if that works out for you, create & call the following script from the end of your /usr/local/etc/rcS

/usr/local/etc/map-overmount.sh


#!/bin/sh
#map-overmount.sh
#shamelessly derived from the pohd overmount script

#Waiting for HDD-plugin to finish...
n=1
while [ ! -d /tmp/hdd/volumes/HDD1/map/ ] ; do
sleep 3
[ $n -gt 30 ] && break
let n+=1
done
#bind map directory:
mount -o bind /tmp/hdd/volumes/HDD1/map/ /usr/local/bin/scripts/map/

make sure you

chmod +x /usr/local/etc/map-overmount.sh
All this is possible with a squashfs. The difference is, if your hard drive should fail or if it should be removed, the stock Canadian-less world would reappear on your player, as God & Realtek intended it.

-wigout

snappy46
10-19-2010, 02:58 AM
Yeah! wigout that would work too. Maybe you should consider changing your nick from "wigout" to "Overmount Lord". :D

Sorry! I hope you have a sense of humour.

py2000
10-19-2010, 01:30 PM
Thanks for the info. I'm not currently using a (internal/USB) hard drive. I was trying to copy from a network drive/shortcut, which I don't think is available during bootup...

wigout
10-19-2010, 02:17 PM
You could.

prepare your files on your network:
your/share/path/map

call network-map-overmount.sh



network-map-overmount.sh

#!/bin/sh
# network-map-overmount.sh
sleep 60
mkdir -p /tmp/hdd/volumes/HDD1/network
ln -s /tmp/hdd/volumes/HDD1/ /tmp/ramfs/volumes
#change ip address to match your share, and MyFiles to match the
#path to your share
#also note that this script mounts your network share in a folder where
#your internal harddrive would normally be. As it isn't there at all, I've
#also symlinked the network mount so you should be able to browse
#your network files by going to browsing the HDD
mount -t cifs //192.168.1.xxx/MyFiles /tmp/hdd/volumes/HDD1/network -o user=user,password=password
sleep 5
#bind map directory:
mount -o bind /tmp/hdd/volumes/HDD1/network/map/ /usr/local/bin/scripts/map/


You might to adjust the sleep times.
And you definitely want to experiment on the commandline with those mount options until you get the phrasing correct.

Anyway, or install the bc16 yaffs2 version....


-wigout

py2000
10-19-2010, 02:27 PM
Tx for the info, but I think I'll just wait for PM to add it to the next stock firmware... :P

leon10701
10-20-2010, 06:50 AM
I used wordpad to modify /usr/local/etc/rcS, and now box won't bootup- stop at screen of "Box office". Yes I did plug in a flash drive with install.img on it and box won't read it too. So Help!!!

snappy46
10-20-2010, 11:52 AM
I used wordpad to modify /usr/local/etc/rcS, and now box won't bootup- stop at screen of "Box office". Yes I did plug in a flash drive with install.img on it and box won't read it too. So Help!!!

You can not use any kind of wordprocessor like msword or wordpad which creates extra formating on your file. rcS file must be plain text or else it does not work anymore. On window I recommend notepad to make any changes to scripts.

Check here http://www.patriotmem.com/forums/showthread.php?p=29915#post29915 for your possible options.

First option is the easiest if you can still telnet to your PBO.

Good Luck.

wigout
10-20-2010, 02:24 PM
Yeah! wigout that would work too. Maybe you should consider changing your nick from "wigout" to "Overmount Lord". :D

Sorry! I hope you have a sense of humour.


Yeah I seriously prefer the mount -o bind trick- there's little you can't do without very little worry of ruining things.
(that said, I'll probably overmount something stupid in short order)

-wigout

mr_ding
12-01-2010, 08:07 PM
Will try the "mount -o bind" method tonight.

Was looking at install.img (after untar), the configuration.xml has HARD-CODED /usr/local/etc to 40MegaBytes. Will decreasing the size from 40 to say 36MegaBytes help in any way?

Let's hope PBO will add 'Canada' to next firmware so we do not need to use this 'bind' method.


EDIT:
If I use TeraTerm from PC into the Patriot Box, editing menu.rss and I see all those ^M character. Should I use ':%s/<ctrl-V><ctrl-M>//g' in VI to remove them?

warzouing
12-09-2010, 06:38 PM
I haven't tried with the other ACRBO firmware versions but have just upgraded to ACRBO4824 and want to let you know that we should copy the 2 .rss files to /usr/local/bin/IMS_Modules/Weather/scripts/map . It's looking good! Thanks to all!

snappy46
12-09-2010, 07:12 PM
EDIT:
If I use TeraTerm from PC into the Patriot Box, editing menu.rss and I see all those ^M character. Should I use ':%s/<ctrl-V><ctrl-M>//g' in VI to remove them?

Those are windows editor delimiter you do not need to delete them. In a matter of fact I suggest you leave them alone.

snappy46
12-09-2010, 07:16 PM
I haven't tried with the other ACRBO firmware versions but have just upgraded to ACRBO4824 and want to let you know that we should copy the 2 .rss files to /usr/local/bin/IMS_Modules/Weather/scripts/map . It's looking good! Thanks to all!

That is correct; in a matter of fact this goes for all ACRBO firmware so far since ACRBO puts there IMS script in the /IMS_modules while the PBO has them in the scripts directory. There are also two version to the Canada weather one for the ACRBO and one for the PBO to get things more pleasing to the eye.

Hugh
12-20-2010, 02:41 AM
Those are windows editor delimiter you do not need to delete them. In a matter of fact I suggest you leave them alone.

That surprises me.

Note: I'm not PBO expert. First posting.

UNIX text files use NewLine to end each line (0x0A).
Windows text files use a CarriageReturn LineFeed pair to end each line (0x0D 0x0A)
or if the Windows text file is using UTF-16, then things get really screwy.
MacOS before 10 used CarriageReturn to end lines. I think OSX uses NewLine to end lines (it's UNIX).

0x0D is Control-M and 0x0A is Control-J.
NewLine and LineFeed are the same codepoint.

Anyway, normally UNIX / Linux programs want you to NOT have those ^M characters. Some are willing to ignore them to keep the peace.

ar125
07-06-2011, 06:55 PM
Even logged in as root got access denied. Got the files onto the box (sorry cant recall which folder) but unable to get them to the folder specified by you. So under weather, still dont see Canada. I think i even tried copying Canada as Albania or something but didnt work.

So basically even with root i am getting access denied.

Found a link somewhere how to change the permissions on a folder (on a linux box) - and even attempted that - still no luck.

Any advice will be appreciated ---- thanks !!!!!

snappy46
07-06-2011, 07:07 PM
Even logged in as root got access denied. Got the files onto the box (sorry cant recall which folder) but unable to get them to the folder specified by you. So under weather, still dont see Canada. I think i even tried copying Canada as Albania or something but didnt work.

So basically even with root i am getting access denied.

Found a link somewhere how to change the permissions on a folder (on a linux box) - and even attempted that - still no luck.

Any advice will be appreciated ---- thanks !!!!!

If you are using a firmware that uses the squashfs filesystem (That would be most of the lastest PBO official firmware) you will not be able to write to the filesystem unless you overmount your /usr/local/bin/scripts/menu.rss. I recommend you try this link (http://www.patriotmemory.com/forums/showthread.php?5550-Improved-IMS-(P61-P70R2)) if you are using a PBO official firmware. This script will do the installation automatically for you and overmount what needs to be mounted and make sure everything is setup properly when the PBO reboots.

Good luck.

ar125
07-06-2011, 07:26 PM
If you are using a firmware that uses the squashfs filesystem (That would be most of the lastest PBO official firmware) you will not be able to write to the filesystem unless you overmount your /usr/local/bin/scripts/menu.rss. I recommend you try this link (http://www.patriotmemory.com/forums/showthread.php?5550-Improved-IMS-(P61-P70R2)) if you are using a PBO official firmware. This script will do the installation automatically for you and overmount what needs to be mounted and make sure everything is setup properly when the PBO reboots.

Good luck.

Thanks Snappy - will try this hopefully this weekend, and update this thread.

ar125
07-13-2011, 05:14 PM
thank you very much snappy46!! Worked amazingly. I will try and follow your related posts for any further steps.

Keep up the great work!!

snappy46
07-13-2011, 05:21 PM
thank you very much snappy46!! Worked amazingly. I will try and follow your related posts for any further steps.

Keep up the great work!!

You're welcome glad this helped you out.

Mr. Gadget
07-18-2011, 09:39 PM
Great Weather display --

Can we add High and Low temp for the CURRENT day? Current Temp doesn't tell me how High/Low it will get for the day, only future days.

Thanx,

Chris

snappy46
07-19-2011, 12:01 PM
Great Weather display --

Can we add High and Low temp for the CURRENT day? Current Temp doesn't tell me how High/Low it will get for the day, only future days.

Thanx,

Chris

It might be possible I am not sure I would have to look at the code and see what I can do. As it stands right now I am using mikka's weather remake here at home. I tried way back to incoporate the two together PM Weather + mikka's remake but I was not successful at the time. To tell you the truth the Improved IMS is a little bit out of date and needs updating. Many more goodies have shown up since the script was first created that could be added.

Unfortunately being now the summer here; my computer time is close to nil and development on various project is pretty much at a stand still; I just rather be sitting outside in the summer drinking beers than pulling my hairs in front of the computer screen. Things should resume back to normal in the fall and hopefully I can find the time to tackle some of the ideas that are going around in my head.

Cheers !!!

Mr. Gadget
08-04-2011, 11:34 PM
I updated weather.rss to include the Current Forecast High/Low. Here is the code.
I had to move some of the existing images to other lines to make space for the High/Low info.

Enjoy!




Find section:
unitSpeed=getXMLAttribute("rss","channel","yweather:units","speed");

ADD unitHigh=getXMLAttribute("rss","channel","item","yweather:forecast",0,"high");
ADD unitLow=getXMLAttribute("rss","channel","item","yweather:forecast",0,"low");

windTemperature=getXMLAttribute("rss","channel","yweather:wind","chill");

REPLACE/ADD following section:
<text offsetXPC=11 offsetYPC=27 widthPC=32 heightPC=5 fontSize=12 foregroundColor=255:255:255>
<script> print(nowDesc); </script>
</text>


<text offsetXPC=10 offsetYPC=33 widthPC=16 heightPC=5 fontSize=13 foregroundColor=128:128:128>
<script> print(t_High); </script>
</text>
<text offsetXPC=15 offsetYPC=33 widthPC=16 heightPC=5 fontSize=13 foregroundColor=255:255:255>
<script> print(unitHigh + " °" + unitTemperature); </script>
</text>

<text offsetXPC=26 offsetYPC=33 widthPC=16 heightPC=5 fontSize=13 foregroundColor=128:128:128>
<script> print(t_Low); </script>
</text>
<text offsetXPC=31 offsetYPC=33 widthPC=16 heightPC=5 fontSize=13 foregroundColor=255:255:255>
<script> print(unitLow + " °" + unitTemperature); </script>
</text>

<text offsetXPC=10 offsetYPC=38 widthPC=16 heightPC=5 fontSize=13 foregroundColor=128:128:128>
<script> print(t_Windchill); </script>

Mr. Gadget
08-04-2011, 11:51 PM
While displaying the Current and Forecast weather, I hit the 'Enter' key (or was it the right arrow?) and a secondary Black Box displays on the right side of screen, covering Forecast and partial Current. It has either "Full News" or "Short Description" in yellow text as a label on the bottom, with arrows left or right, also 0/1, and 1/1.

What is this? How can we update the content? I search for "Full News" and "Short Description" on the PBO and could not find anything with this text.

Point me in the right direction and I might be able to add content to it.

Thx,

Chris