Frozen Pachube Feed

11 views
Skip to first unread message

Stephendovas

unread,
Nov 2, 2011, 9:57:26 PM11/2/11
to benv2423-2011
Hi Guys,

I know this has been asked before but there still seems to be no
answer. I was wondering how we are to get out feeds LIVE and collect
the needed XML data to implement that into our assignment 2? I have
tried to leave a comment on my chosen feed asking to make it active -
i would email however there is no email address..

Isnt this a crucial part of the assignment as everything is based
around the data??

Just a little confused...

Stephen

Russell Lowe

unread,
Nov 3, 2011, 3:41:05 AM11/3/11
to benv2423-2011
Hi Stephen,

In the case that the feed is frozen (i.e. not live) start by
constructing your flowgraph as if it was a live feed.

Then, create multiple copies of the xml you download from the feed ...
with different (but reasonable) numbers that you insert into the xml
file in the parameter/parameters you are working with. For example ..
if you were reading the temperature the file you download might have a
value of 20degreesC. In the multiple copies you might make the
subsequent values 21degreesC, 25DegreesC, 32degreesC, 25degreesC,
16degreesC and finally 10degreesC. In this, simple case, I've
constructed something that looks like the temperature spike in the
middle of the day ...

Then you can set up your flowgraph to open at the first xml, then the
second, then the third and so on. You'll be able to copy the flowgraph
after each open node ... so remember copy and "paste with links" so
you don't have to re-link everything.

Does that make sense?

I'm sure Vinh will have some advice on setting up the flowgraph as
well.

Cheers

Vinh Nguyen

unread,
Nov 3, 2011, 5:33:27 AM11/3/11
to benv2423-2011
The only thing you need to be careful of when reading multiple xml
files is to navigate through 1 at a time. Following on from Russell's
example, if you named each of the xml files: file1, file2, file3,
file4. AND put them in the same folder [eg. your mod folder], then you
can use just 1 flowgraph to read them in sequence.

See my post on my blog: http://benv2423-2011vn.blogspot.com/2011/11/reading-multiple-xml-files.html

and my attempt to post an image on here (fingers crossed):

<a href="http://1.bp.blogspot.com/-CVfTbLbIBnM/TrJeSAYddVI/AAAAAAAAAEY/
7kRQ4EXgU-A/s1600/OpenXML-loop.jpg"><img border="0" height="378"
src="http://1.bp.blogspot.com/-CVfTbLbIBnM/TrJeSAYddVI/AAAAAAAAAEY/
7kRQ4EXgU-A/s640/OpenXML-loop.jpg" width="640" /></a>

Stephendovas

unread,
Nov 3, 2011, 5:35:26 AM11/3/11
to benv2423-2011
Hey Russell,

Thanks very much for the reply. Ok I understand what you mean,
basically just create my own numbers to insert into the xml file which
downloaded, then hopefully when it goes live I can switch it all over.
I watched Vinh's Tutorial and noticed how to "copy and paste" with the
links - saves so much time!

Once again thank you for the reply

Stephen.

On Nov 3, 6:41 pm, Russell Lowe <russell.l...@gmail.com> wrote:

Stephendovas

unread,
Nov 3, 2011, 8:21:26 AM11/3/11
to benv2423-2011
Ok I took a look at your image on your blog vinh, i think i understand
what you mean

Thanks very much.
Message has been deleted

Matt

unread,
Nov 6, 2011, 4:41:53 AM11/6/11
to benv2423-2011
Hey Vinh

Do you think you could re upload those last 2 photos please as they
are currently unavailable.
i have a feeling they will help alot with working out how to read
multiple XML files

cheers

Vinh Nguyen

unread,
Nov 6, 2011, 9:44:11 PM11/6/11
to benv2423-2011
Hi Matt,

The images can be found here:
http://benv2423-2011vn.blogspot.com/2011/11/reading-multiple-xml-files.html

And to answer the question you've posted on my blog:

"Matthew Whellan said...

Hey Vinh
just trying to get this XML working properly.
i am fairly certain that i am naming the 'file' wrong within the
flowgraph

just wondering if you could elaborate on what goes into the 'file/
Name' of the xml nodes. in particular the String: Combine
"

The string:combine node takes 2 strings (a data type using letters/
numbers) and joins them. So "Hello" + "World" becomes: "HelloWorld"

The flowgraph example I posted allows you to suffix a file name with a
number that is output from a counter. I used "file" but it can be
anything (eg "myData"). If you need to change the file name in the
flowgraph to match your XML files in your mod folder, edit the
string:combine node and change A=file to A=myData or whatever.

So when I press num_7 the counter outputs "1" this combines with
"file" and outputs "file1". Then the follow nodes open "file1.xml" in
the mod folder and gets the child named "child" get the next child
named "grandchild" then gets the value stored there. It then waits one
(1) sec, before going back to the beginning.

The second time through, it obviously increments the counter to output
"2"...which means "file2" gets opened.

So if you name your XML files "file1", "file2", "file3"...etc and
place them in your mod folder, the flow graph example I posted will
open them 1 after the other. It will fail to open when it reaches a
file# that it cannot find.

Hope that helps,

Vinh
Reply all
Reply to author
Forward
0 new messages