Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
PS Variable Feed Question
This thread has 13 replies. Displaying all posts.
Post 1 made on Wednesday February 4, 2009 at 11:50
Evohome
Active Member
Joined:
Posts:
April 2008
686
Here's one that I hope should be fairly easy to solve...

I am working on a PS module that is freely available, and am modifying it somewhat to fit my needs. I have limited but working knowledge of PS, and am learning everythign hands-on.

Here's what I want it to do:

One particular "box" that receives variable feedback has a total of eight different variables, which are fixed (variables won't ever change from these 8), and only change every few days. I want to link a definition based on each of the eight variables back to separate text boxes/ pages which will hold the definitions (I already have those pages built for the 9600). Unfortunately, I can't find any actual XML feeds for the definitions, or that would simplify things quite a bit.

Basically, if V=1, then goto D1, if V=2, then goto D2, etc., etc. The definition will be displayed by tapping on the variable box (button).

Does that make sense?

Thanks in advance for any help.
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 2 made on Wednesday February 4, 2009 at 11:54
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Not really. Is goto D1/goto D2 a page jump? What is the feed source? HTTP? RS-232?

There is not enough information here for me to make a recommendation.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Wednesday February 4, 2009 at 12:06
Evohome
Active Member
Joined:
Posts:
April 2008
686
I plan on making the goto a page jump to each definition, as there is no actual XML feed that I can find for the definitions.

The source feed is HTTP.
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 4 made on Wednesday February 4, 2009 at 20:15
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Evo,

You still have not provided enough information for someone to hand you a script, which, I presume, is what you want. If your current config is PEPv1 and you'd like some help, email it to me and I'll have a look. We can take it offline from here.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 5 made on Wednesday February 4, 2009 at 21:08
Evohome
Active Member
Joined:
Posts:
April 2008
686
Lyndel,

I would prefer not to have someone hand it to me. I would rather figure it out myself, but am just at a point where I am stuck. I am only hoping to get a little help in erfining what I want to do. I will work on it some more tonight, and will get in touch with you if I can't figure it out.

Thanks for your help.

Brandon
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 6 made on Wednesday February 4, 2009 at 23:27
Spudnic
Long Time Member
Joined:
Posts:
January 2009
10
I agree, I'm not sure that I understand the underlying question. You're trying to pull in some variable data from an HTTP server ... and the file you're getting is HTML or XML?

I mean this doesn't sound too different from what's been done in the weather scripts. My script was recently posted and pulls in XML from weather.com and loads it up. It gives examples of how to references the XML using E4X (absolutely beautiful if you've ever done JS where you had to parse down using DOM references ... ugh).

Some more clarity on the actual challenge you're trying to solve would be helpful.
OP | Post 7 made on Thursday February 5, 2009 at 01:32
Evohome
Active Member
Joined:
Posts:
April 2008
686
Pulling XML variables, eight different total, from a site like the Farmers Almanac.


It's an astronomy thing for lunar phases. Based on the lunar phase, like the one that is happening now (waxing or waxing gibbous), I set up a relation of some kind where the user can tap on the displayed phase, and that takes them to the definition for that phase, which will be one of eight pages.

What I need to figure out is how to "read" the actual phase and then relate that particular phase to the definition. If P (Phase) = 1, then goto D (Definition Page) 1, If P = 2, then goto D2, etc.

Let's say that P1 is today's variable (which is the waxing gibbous). P1 displays on the Astronomy/ Lunar Phase page. The user can tap on the P1 icon (hidden button), which then page flips to the definition for that phase.

I have some working knowledge of this stuff, and am reading the Dev Guide now, but am limited in overall experience (for now)...
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 8 made on Friday February 6, 2009 at 03:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Search this forum for "new XML(" for last 2 years and you should find the means to construct XML data from the body of an HTTP response that you've received.

There are 2 posts, one with direct TCP and the other is, IIRC, from an HTML response.

You can then download the TSU9400 weather module that is directly pulling data from the XML object tree that is downloaded from weather.com's RSS feed. You can compare source code to xml structure and that should give you pretty much all info you need.

If you encounter XML namespaces, I'd suggest downloading and reviewing a PDF for ECMA357 (E4X) javascript extensions as there are some examples there that discuss the default namespace and how to retrieve XML elements that are NOT in the default namespace.

Last edited by Lyndel McGee on February 7, 2009 17:50.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 9 made on Saturday February 7, 2009 at 16:28
Evohome
Active Member
Joined:
Posts:
April 2008
686
thanks for the help Lyndel
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 10 made on Saturday February 7, 2009 at 17:35
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Did that get you sorted out?
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 11 made on Saturday February 7, 2009 at 18:01
Pulse-R
Long Time Member
Joined:
Posts:
January 2009
10
If you want to do page jumps, you need to set up some hidden buttons for each page jump, and then do executeActions() for the page you want to jump to.
So if V=1 then button1.executeActions(); for example..

Simon
DIY it the right way
Post 12 made on Sunday February 8, 2009 at 00:43
Spudnic
Long Time Member
Joined:
Posts:
January 2009
10
I created a weather.com script, available here on remotecentral, that you might be able to leverage / modify. It pulls in XML from weather.com, and it contains the moon phase as well in the data set. It would show you how I've done it to either write your own, or pick up what I've done for modifications.

I suspect what you're trying to do is switch based on a text based variable. So, right now weather.com says the moon phase is "Waxing Gibbous" ... you'd have to know the exact textual returns that are possible, and then test against those.

Someone asked me, "how do I get the days in the forecast to be German." For this I'm considering doing something similar ... have a translation page. I know weather.com is going to give me "Monday", "Tuesday", etc. I'm going to setup a translation page which would allow him to put in "Montag", "Dienstag", etc. Then I'll test for "Monday" from weather.com and replace it with the text he's entered in the translation page. For this, you could use a simple IF ... Then .. Else construct ... or there is another option of Switch ...

switch(varDayName) {
case "Monday":
widget("mywidget").label = widget("mon_translate").label;
break;
case "Tuesday":
widget("mywidget").label = widget("tue_translate").label;
break;
}

If you're learning JavaScript, I'd like to highly recommend http://www.devguru.com as a reference. It's not good for learning, but it's indespensible as a reference (I always forget syntax).

Since I know that there are limited return options on the days of the week, I can cover all the cases. At the time that we add another day of the week, the script would need to be rewritten ... but that's about as unlikely as coming up with more phases of the moon.

I hope this helps, I believe your details helped me with where you were having issues.
OP | Post 13 made on Sunday February 8, 2009 at 14:46
Evohome
Active Member
Joined:
Posts:
April 2008
686
Lyndel, still working this out.

Pulse, I've got the page jumps knocked out, thanks.

Spud, I took a look at your script, and really like it. I have been modifying it for a 9600, and can forward the mods to you.

Again, I appreciate your help guys. Unfortunately, it looks like I will have even more time to work on this stuff, as it's slowing down even more...
Two more CIs are closing shop in the next couple weeks. One has been open for over 45 years.

A framing contractor I work with just laid off more employees, bringing the total to over 350...


crap
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 14 made on Sunday February 8, 2009 at 21:01
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Market is really tight right now. With regard to 9600 weather, there's the Meteo script or I have one that I license support for that looks just like Yahoo Weather.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse