Hey there,
I wanted to update you on my progress with the Pebble Watch project. I've switched over to using an official external API to make HTTP requests for values, and now I'm receiving results in XML format instead of JSON.
Here's a snippet of the XML response that I get from calling the API:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<items>
<item id="1234567">
<author gender="man" country="France" region="Ile-de-France">myuser</author>
<category>mycategory</category>
<date>2010-08-23T05:48:51+02:00</date>
<from />
<text>THIS IS THE CONTENT</text>
<comments_flag>1</comments_flag>
<short_url>http://myshort.url</short_url>
</item>
</items>
<comments />
<active_key>1234567890</active_key>
<code>1</code>
<pubdate>2014-07-12T18:51:49+02:00</pubdate>
<language>fr</language>
<errors />
</root>
Now, here's what my SimplyJS script looks like:
simply.on('accelTap' || 'singleClick', function(e) {
simply.body("Loading...");
ajax({ url: 'http://myAPIurl', type:'xml' }, function(data){
simply.scrollable(true);
simply.body(data);
});
//}
});
Currently, the entire XML is being displayed on my Pebble. However, I'm only interested in extracting the content under the < text > section.
I've attempted to use some selectors like "data.text," similar to how it works with JSON, but I keep encountering object errors.
Thanks so much for any help!