<html><body bgcolor="#FFFFFF"><div><br></div><div><br>On 6 Dec 2010, at 01:26, FernandoG &lt;<a href="mailto:dataferx@gmail.com">dataferx@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>Hi <br>I am trying to comunicate pd with data coming from pachube (<a href="http://www.pachube.com"><a href="http://www.pachube.com">www.pachube.com</a></a>) using a python script. The script ask for data from pachube web and convert the data to OSC protocol. Then the OSC mesagge is sent to pd. Pd recibe the OSC mesagge but something is wrong when unpack and route the data. <br></div></blockquote><div><br></div><div>It looks like someone is solving the same problem in Max. Maybe worth a look...</div><div><br></div><a href="http://www.frankmacdonald.co.uk/digital-economy-news/parsing-pachube-xml-data-directly-into-maxmsp-updated-version.html">http://www.frankmacdonald.co.uk/digital-economy-news/parsing-pachube-xml-data-directly-into-maxmsp-updated-version.html</a><div><br></div><div>Jamie</div><div><br></div><div><br><blockquote type="cite"><div>
Data can not get in a number box object, this error mesagge is diplayed in console:&nbsp;&nbsp; error: gatom: no method for '1'<br><br>The python script<br><br># to receive data<br>import urllib2<br># to send on with OpenSoundControl, OSC<br>
from simpleOSC import *<br>import time<br><br><br>initOSCClient('127.0.0.1', 57110)<br>while 1:<br>&nbsp; data=urllib2.urlopen('<a href="http://api.pachube.com/v2/feeds/2791.csv?key=hereyourcode">http://api.pachube.com/v2/feeds/2791.csv?key=hereyourcode</a>')<br>
&nbsp; for l in data: <br>&nbsp;&nbsp;&nbsp; d = l.strip().split(",", 2)<br>&nbsp;&nbsp;&nbsp; print d<br>&nbsp;&nbsp;&nbsp; sendOSCMsg('/test/num',d[0])&nbsp; <br>&nbsp;&nbsp;&nbsp; sendOSCMsg('/test/val',d[2]) <br>&nbsp;&nbsp;&nbsp; time.sleep(5) # wait here some secs<br><br><br>
the patch<br><br>#N canvas 599 0 450 476 10;<br>#X declare -lib mrpeach;<br>#X obj -217 25 import mrpeach;<br>#X obj -220 112 unpackOSC;<br>#X floatatom -219 277 5 0 0 0 - - -;<br>#X obj -214 148 routeOSC /test;<br>#X obj -191 348 print;<br>
#X floatatom -150 281 5 0 0 0 - - -;<br>#X obj -219 66 udpreceive 57110;<br>#X floatatom -92 290 5 0 0 0 - - -;<br>#X obj -204 205 routeOSC /val /num;<br>#X connect 1 0 3 0;<br>#X connect 3 0 8 0;<br>#X connect 6 0 1 0;<br>
#X connect 8 0 2 0;<br>#X connect 8 1 5 0;<br>#X connect 8 1 4 0;<br>#X connect 8 2 7 0;<br><br><br>any idea?<br><br>thanks<br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Pd-list@iem.at mailing list</span><br><span>UNSUBSCRIBE and account-management -&gt; http://lists.puredata.info/listinfo/pd-list</span><br></div></blockquote></div></body></html>