Permalink
Browse files

Parser fixes

  • Loading branch information...
1 parent 1626f2b commit 8161b4510bb85604c0f5bbb2afd7935c8002c463 @crawft crawft committed Sep 12, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 flickr-conduit.js
View
@@ -78,16 +78,16 @@ var parseFlickrPost = function(content, callback) {
xml.on('end', function(data) {
try {
// We possibly get multiple entries per POST
- var entries = Array.isArray(data.entry) ? data.entry : [data.entry];
+ var entries = Array.isArray(data.feed.entry) ? data.feed.entry : [data.feed.entry];
var imgData = null;
var photoUrl= null;
for (var i in entries) {
- imgData = entries[i]['media:content']['@'];
-
+ imgData = entries[i]['media:content'][0]['$'];
+
// Dumb, but there's a bug in the xml2js that messes up on the <link> tab. (Or I'm missing something.)
- var id = entries[i]['id'].split(':')[2].split('/')[2];
- photoUrl = entries[i].author.uri.replace("http://www.flickr.com/people/", 'http://www.flickr.com/photos/');
+ var id = entries[i]['id'][0].split(':')[2].split('/')[2];
+ photoUrl = entries[i].author[0].uri[0].replace("http://www.flickr.com/people/", 'http://www.flickr.com/photos/');
photoUrl += id + '/';
imgObjs.push({

0 comments on commit 8161b45

Please sign in to comment.