feed_crawler/storage.rb
#News articles are saved in JSON and then send over a STOMP message queue.
News articles are saved in JSON and then send over a STOMP message queue.
News articles are saved in JSON and then send over a STOMP message queue .
def store_article(author, link, headline, content, clean_content, newsservice)
      begin
        document = JSON.generate({
          'author' => author,
          'link' => link,
          'headline' => headline,
          'content' => content,
          'clean_content' => clean_content,
          'news_vendor' => newsservice
        })
        @client.publish('queue/rawarticles', document)
        Log4r::Logger['main'].info "Send '#{headline}'"
      rescue Exception => ex
        Log4r::Logger['main'].error "Could not send article: #{ex.message}"
      end
    end
def store_article ( author , link , headline , content , clean_content , newsservice ) begin document = JSON . generate ( { 'author' => author , 'link' => link , 'headline' => headline , 'content' => content , 'clean_content' => clean_content , 'news_vendor' => newsservice } ) @client . publish ( 'queue/rawarticles' , document ) Log4r :: Logger [ 'main' ] . info "Send '#{headline}'" rescue Exception => ex Log4r :: Logger [ 'main' ] . error "Could not send article: #{ex.message}" end end
News articles are saved in JSON and then send over a STOMP message queue.
News articles are saved in JSON and then send over a STOMP message queue .
author
<not_specific>
link
<not_specific>
headline
<not_specific>
content
<not_specific>
clean_content
<not_specific>
newsservice
<not_specific>