Dear list,
is there any option to convert automatically webpage content to xml in PD? I would like to create some interactive installations based on web content, and still looking for a simple way.
Thanks in advance for any advice.
Best:
Popesz
HI,
On 02.04.2016 12:12, Csaba Láng wrote:
Dear list,
is there any option to convert automatically webpage content to xml in PD? I would like to create some interactive installations based on web content, and still looking for a simple way.
Converting a symbol into XML or DOM is not possible with Pd, but you could write your parser in a seperate program, e.g. using Python and Beautiful Soup (https://pypi.python.org/pypi/beautifulsoup4).
Then you can send the data to Pd using UDP and [netreceive] in Pd.
If you can control the webserver, you could output the data as JSON and then use my extension PuREST JSON: http://ix.residuum.org/pd/purest_json.html
Hth, Thomas
On 2016-04-02 12:12, Csaba Láng wrote:
Dear list,
is there any option to convert automatically webpage content to xml in PD? I would like to create some interactive installations based on web content, and still looking for a simple way.
how do you convert webpage content to XML in *any language*?
attached is a very simplistic example, exploiting the underspecification of your problem space.
the patch uses mrpeach/net and mrpeach/binfile to demonstration purposes (fetching the HTML from a live website, saving the XML to a file), but the actual "conversion" is done in Pd-vanilla.
i haven't tested it excessively, but the conversion i did test (the one encoded into the example patch) validates as correct XML.
gfmasdr IOhannes
Thanks, gentlemen for the prompt and proper answer. Python is a good approach, but a pure PD solution is always the most welcome.
Updates with some results are coming soon.
Best:
Popesz
On Mon, Apr 4, 2016 at 12:17 PM, IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 2016-04-02 12:12, Csaba Láng wrote:
Dear list,
is there any option to convert automatically webpage content to xml in
PD?
I would like to create some interactive installations based on web
content,
and still looking for a simple way.
how do you convert webpage content to XML in *any language*?
attached is a very simplistic example, exploiting the underspecification of your problem space.
the patch uses mrpeach/net and mrpeach/binfile to demonstration purposes (fetching the HTML from a live website, saving the XML to a file), but the actual "conversion" is done in Pd-vanilla.
i haven't tested it excessively, but the conversion i did test (the one encoded into the example patch) validates as correct XML.
gfmasdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list