The code powering m.abunchtell.com https://m.abunchtell.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

24 行
684 B

  1. class ProcessFeedService
  2. def call(body, account)
  3. xml = Nokogiri::XML(body)
  4. xml.xpath('/xmlns:feed/xmlns:entry').each do |entry|
  5. uri = entry.at_xpath('./xmlns:id').content
  6. status = Status.find_by(uri: uri)
  7. next if !status.nil?
  8. status = Status.new
  9. status.account = account
  10. status.uri = uri
  11. status.text = entry.at_xpath('./xmlns:content').content
  12. status.created_at = entry.at_xpath('./xmlns:published').content
  13. status.updated_at = entry.at_xpath('./xmlns:updated').content
  14. status.save!
  15. # todo: not everything is a status. there are follows, favourites
  16. # todo: RTs
  17. end
  18. end
  19. end