Hi,
I've had some success grabbing XML feed from Pinterest and Facebook, using the following URLS:
http://pinterest.com/travelchanneleu/feed.rss
https://www.facebook.com/feeds/page.php?id=51539791474&format=rss20
I can map the feed to a model, store and view relatively easily. The problem I have is that both responses from the above links contain, for example, images and text inside one part of the response.
My question is, how would I go about splitting up the description part below, in the pinterest description feed I get both the image and text:
Code:
<description><p><a href="/pin/98868154291824290/"><img src="http://media-cache-ec2.pinterest.com/192x/03/45/5f/03455ff1a62e80f4c0f59c475bf416e6.jpg"></a></p><p>Airport 24/7 : Miami If you think you know life in an airport, think again. This is Miami Airport as you've never seen it before.</p>
</description>
I'm pretty sure I would have to use a convert function on the model. Would I have to do something like Ed Spender did here for his APOD carousel?
Code:
convert: function(value, record) {
var content = record.get('content'),
regex = /img src=\"([a-zA-Z0-9\_\.\/\:]*)\"/,
match = content.match(regex),
src = match[1];
if (src != "" && !src.match(/\.gif$/)) {
src = "http://src.sencha.io/screen.width/" + src;
}
return src;
}
Any help would be much appreciated.....or any useful resources how to use the convert function on a model! I don't really understand the code above very well.
Thanks,
:-)