Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:newscloud/n2

  • Loading branch information...
commit 0b24bed593531fcdab565d09c090255d958a3614 2 parents 51d8e72 + dd41951
Jeff Reifman authored
Showing with 5 additions and 0 deletions.
  1. +4 −0 lib/feed_parser.rb
  2. +1 −0  lib/tasks/feeds.rake
View
4 lib/feed_parser.rb
@@ -42,11 +42,15 @@ def get_value feed_object, fields, is_atom
command = fields.select { |field| feed_object.respond_to? field }.first
return nil unless command.present?
+ # If atom feed, we need to call content on the field to get the data
+ original_command = command
command = is_atom == true ? (command == 'link' ? [command, 'href'] : [command, 'content']) : command
begin
command.inject(feed_object) { |item, cmd| item.send(cmd) }
rescue NoMethodError
+ subfields = fields.delete(original_command)
+ return get_value(feed_object, subfields, is_atom) if subfields and subfields.present?
nil
end
end
View
1  lib/tasks/feeds.rake
@@ -60,6 +60,7 @@ def update_feed(feed)
:feed => feed
})
if feed.load_all?
+ puts "\t\tRunning quick post"
newswire.quick_post
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.