I tried asking this on StackOverflow a little bit ago and I never got a response. The project is urgent.
I am trying to use Google’s Feed API to get images using a feed inside of an AngularJS controller. It will successfully get three images then it will hit a twitter URL and it get’s confused and breaks the script. I want it to skip over that and keep loading images. Is there anyway to do that?
Error:
Error: Syntax error, unrecognized expression: submitted by <a href="http://www.reddit.com/user/lachlan_jp"> lachlan_jp </a> <br> <a href="https://twitter.com/caseandpointdjs/status/552222732994482178">[link]</a> <a href="http://www.reddit.com/r/Monstercat/comments/2rg0nr/case_points_new_single_will_be_premiering/">[8 comments]</a>
Code:
$http.get("http://ajax.googleapis.com/ajax/services/feed/load", { params: { "v": "1.0", "q": "http://www.reddit.com/r/monstercat/.rss", "num": "100" } })
.success(function(data) {
$scope.rssTitle = data.responseData.feed.title;
$scope.rssUrl = data.responseData.feed.feedUrl;
$scope.rssSiteUrl = data.responseData.feed.link;
$scope.entries = data.responseData.feed.entries;
var data = data.responseData.feed;
var findFirstImage = data.entries.content;
angular.forEach(data.entries, function(value){
value.sapleImage = $(value.content).find('img').eq(0).attr('src');
console.log(value.sapleImage);
})
})
.error(function(data) {
console.log("ERROR: " + data);
});
}