Skip to content

Commit

Permalink
Workaround to handle post and get requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigods committed Jun 25, 2013
1 parent 3e3ec91 commit cd04ead
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/atom.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ function feedToJSON(feed) {
}

function entryToJSON(entry) {
console.log("ENTRY: " + entry);
var id = exports.get(entry, 'atom:id');
var sourceId = exports.get(entry, 'atom:source/atom:id');
var author = exports.get(entry, 'atom:author');
var authorName = author ? exports.get(author, 'atom:name') : author;
var published = exports.get(entry, 'atom:published');
var updated = exports.get(entry, 'atom:updated');
var content = exports.get(entry, 'atom:content');
var media = structuredFieldToJSON(exports.get(entry, 'atom:media'),

// Workaround to handle entries result from post and get
var media = structuredFieldToJSON(entry.get('//media') || exports.get(entry, 'atom:media'),
function(item) {
var id = item.attr('id').value();
var channel = item.attr('channel').value();
Expand All @@ -127,6 +130,7 @@ function entryToJSON(entry) {
}

function structuredFieldToJSON(field, parser) {
console.log("MEDIA: " + field);
var json = [];
if (field) {
var items = field.childNodes();
Expand Down

0 comments on commit cd04ead

Please sign in to comment.