cleaned process function in ostatus parser
This commit is contained in:
parent
7142803bf2
commit
4179b94043
2 changed files with 7 additions and 5 deletions
Binary file not shown.
|
|
@ -4,15 +4,17 @@ module Diaspora
|
||||||
def self.process(xml)
|
def self.process(xml)
|
||||||
doc = Nokogiri::HTML(xml)
|
doc = Nokogiri::HTML(xml)
|
||||||
|
|
||||||
author_hash = self.author(doc)
|
hash = {}
|
||||||
author_hash[:hub] = self.hub(doc)
|
hash[:author] = self.author(doc)
|
||||||
|
hash[:author][:hub] = self.hub(doc)
|
||||||
|
|
||||||
entry_hash = self.entry(doc)
|
hash[:entry] = self.entry(doc)
|
||||||
|
|
||||||
author = Author.instantiate(author_hash)
|
author = Author.instantiate(hash[:author])
|
||||||
author.ostatus_posts.create(entry_hash) if entry_hash[:message]
|
author.ostatus_posts.create(hash[:entry]) if hash[:entry][:message]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.author(doc)
|
def self.author(doc)
|
||||||
return {
|
return {
|
||||||
:service => self.service(doc),
|
:service => self.service(doc),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue