feed_crawler/storage.rb
#Stores a news article in a mysql database
Stores a news article in a mysql database
Stores a news article in a mysql database
def store_article(author, link, headline, content, clean_content, newsservice)
      begin
        @@lock.synchronize do
          @@stmt.execute(author.encode('UTF-8'), link.encode('UTF-8'), 
            headline.encode('UTF-8'), content.encode('UTF-8'), 
            clean_content.encode('UTF-8'), newsservice.encode('UTF-8'))
        end
      rescue Exception => ex
        Log4r::Logger['main'].error "Could not save to database: #{ex.message}"
      end
    end
def store_article ( author , link , headline , content , clean_content , newsservice ) begin @@lock . synchronize do @@stmt . execute ( author . encode ( 'UTF-8' ) , link . encode ( 'UTF-8' ) , headline . encode ( 'UTF-8' ) , content . encode ( 'UTF-8' ) , clean_content . encode ( 'UTF-8' ) , newsservice . encode ( 'UTF-8' ) ) end rescue Exception => ex Log4r :: Logger [ 'main' ] . error "Could not save to database: #{ex.message}" end end
Stores a news article in a mysql database
Stores a news article in a mysql database
author
<not_specific>
link
<not_specific>
headline
<not_specific>
content
<not_specific>
clean_content
<not_specific>
newsservice
<not_specific>