Sha256: ee0afd1c6e68a851fc1b918f5095dd3474736338add3ff515958f514b9e3a68d

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

require 'cgi'
require 'lib/jkl/rest_client.rb'
require 'lib/jkl/rss_client.rb'
require 'lib/jkl/calais_client.rb'
require 'lib/jkl/url_doc_handler.rb'

module Jkl
  
  def headlines(keyphrase)
    get_from_as_xml "#{YAML::load_file('config/config.yml')['topix']}#{CGI::escape(keyphrase)}"
  end

  def pages(headlines)
    items = get_items_from headlines
    descriptions = ""
    items.each do |item| 
      descriptions << attribute_from(item, :description).gsub("<![CDATA[",'').gsub("]]>",'')
    end
    descriptions
  end

  def tags(pages)
    cal_response = get_from_calais(pages)
    get_tag_from_json(cal_response)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sshingler-jkl-0.0.5 lib/jkl.rb