diff --git a/app/controllers/reuters_controller.rb b/app/controllers/reuters_controller.rb
index 0ac1596..603a824 100644
--- a/app/controllers/reuters_controller.rb
+++ b/app/controllers/reuters_controller.rb
@@ -1,11 +1,12 @@
require 'rubygems'
require 'nokogiri'
require 'open-uri'
+require 'AlchemyAPI'
class ReutersController < ApplicationController
# list all
def overall_ratios
- result = fetch_element_by_css('div#overallRatios')
+ result = fetch_element_by_css("http://uk.reuters.com/business/quotes/overview?symbol=#{params[:name]}", 'div#overallRatios')
respond_to do |format|
format.xml { render xml: result, status: :ok }
@@ -13,7 +14,7 @@ def overall_ratios
end
def chart
- result = fetch_element_by_css('div#companyOverviewChart')
+ result = fetch_element_by_css("http://uk.reuters.com/business/quotes/overview?symbol=#{params[:name]}", 'div#companyOverviewChart')
respond_to do |format|
format.xml { render xml: result, status: :ok }
@@ -21,7 +22,7 @@ def chart
end
def competitors
- tmp = fetch_element_by_css('div.module')
+ tmp = fetch_element_by_css("http://uk.reuters.com/business/quotes/overview?symbol=#{params[:name]}", 'div.module')
result = ""
tmp.each do |node|
@@ -33,10 +34,43 @@ def competitors
respond_to do |format|
format.xml { render xml: result, status: :ok }
end
- end
+ end
- def fetch_element_by_css(selector)
- page = Nokogiri::HTML(open("http://uk.reuters.com/business/quotes/overview?symbol=" + params[:name]))
+ def fetch_element_by_css(url, selector)
+ page = Nokogiri::HTML(open(url))
page.css(selector)
end
+
+ #######
+
+ def test
+ @result = fetch_element_by_css("http://uk.reuters.com/business/quotes/companyProfile?symbol=#{params[:name]}", "div#companyNews div.moduleBody").to_s
+
+ words = Array.new()
+ color_hash = Hash.new()
+ alchemyapi = AlchemyAPI.new()
+
+ response = alchemyapi.entities('text', @result, { 'sentiment'=>0 })
+
+ if response['status'] == 'OK'
+ for entity in response['entities']
+
+ if color_hash[entity['type']].nil?
+ r = rand(255)
+ g = rand(255)
+ b = rand(255)
+
+ color_hash[entity['type']] = "#{r}, #{g}, #{b}"
+ end
+
+ words << [entity['text'], entity['type'], color_hash[entity['type']]]
+ end
+ end
+
+ words.each { |word| @result.gsub!(/\b(#{word[0]})\b/i, '\1')}
+
+ # respond_to do |format|
+ # format.xml { render xml: @result.html_safe, status: :ok }
+ # end
+ end
end
\ No newline at end of file
diff --git a/app/views/reuters/test.html.erb b/app/views/reuters/test.html.erb
new file mode 100644
index 0000000..5ace57b
--- /dev/null
+++ b/app/views/reuters/test.html.erb
@@ -0,0 +1 @@
+<%= @result.html_safe %>
\ No newline at end of file
diff --git a/config/application.rb b/config/application.rb
index 214cec5..6c1df22 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -64,5 +64,8 @@ class Application < Rails::Application
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
+
+ config.autoload_paths += %W(#{config.root}/lib)
+ config.autoload_paths += Dir["#{config.root}/lib/**/"]
end
end
diff --git a/lib/alchemyapi.rb b/lib/alchemyapi.rb
new file mode 100644
index 0000000..5c79af4
--- /dev/null
+++ b/lib/alchemyapi.rb
@@ -0,0 +1,705 @@
+
+# Copyright 2013 AlchemyAPI
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+require 'rubygems'
+require 'net/http'
+require 'uri'
+require 'json'
+
+class AlchemyAPI
+
+ #Setup the endpoints
+ @@ENDPOINTS = {}
+ @@ENDPOINTS['sentiment'] = {}
+ @@ENDPOINTS['sentiment']['url'] = '/url/URLGetTextSentiment'
+ @@ENDPOINTS['sentiment']['text'] = '/text/TextGetTextSentiment'
+ @@ENDPOINTS['sentiment']['html'] = '/html/HTMLGetTextSentiment'
+ @@ENDPOINTS['sentiment_targeted'] = {}
+ @@ENDPOINTS['sentiment_targeted']['url'] = '/url/URLGetTargetedSentiment'
+ @@ENDPOINTS['sentiment_targeted']['text'] = '/text/TextGetTargetedSentiment'
+ @@ENDPOINTS['sentiment_targeted']['html'] = '/html/HTMLGetTargetedSentiment'
+ @@ENDPOINTS['author'] = {}
+ @@ENDPOINTS['author']['url'] = '/url/URLGetAuthor'
+ @@ENDPOINTS['author']['html'] = '/html/HTMLGetAuthor'
+ @@ENDPOINTS['keywords'] = {}
+ @@ENDPOINTS['keywords']['url'] = '/url/URLGetRankedKeywords'
+ @@ENDPOINTS['keywords']['text'] = '/text/TextGetRankedKeywords'
+ @@ENDPOINTS['keywords']['html'] = '/html/HTMLGetRankedKeywords'
+ @@ENDPOINTS['concepts'] = {}
+ @@ENDPOINTS['concepts']['url'] = '/url/URLGetRankedConcepts'
+ @@ENDPOINTS['concepts']['text'] = '/text/TextGetRankedConcepts'
+ @@ENDPOINTS['concepts']['html'] = '/html/HTMLGetRankedConcepts'
+ @@ENDPOINTS['entities'] = {}
+ @@ENDPOINTS['entities']['url'] = '/url/URLGetRankedNamedEntities'
+ @@ENDPOINTS['entities']['text'] = '/text/TextGetRankedNamedEntities'
+ @@ENDPOINTS['entities']['html'] = '/html/HTMLGetRankedNamedEntities'
+ @@ENDPOINTS['category'] = {}
+ @@ENDPOINTS['category']['url'] = '/url/URLGetCategory'
+ @@ENDPOINTS['category']['text'] = '/text/TextGetCategory'
+ @@ENDPOINTS['category']['html'] = '/html/HTMLGetCategory'
+ @@ENDPOINTS['relations'] = {}
+ @@ENDPOINTS['relations']['url'] = '/url/URLGetRelations'
+ @@ENDPOINTS['relations']['text'] = '/text/TextGetRelations'
+ @@ENDPOINTS['relations']['html'] = '/html/HTMLGetRelations'
+ @@ENDPOINTS['language'] = {}
+ @@ENDPOINTS['language']['url'] = '/url/URLGetLanguage'
+ @@ENDPOINTS['language']['text'] = '/text/TextGetLanguage'
+ @@ENDPOINTS['language']['html'] = '/html/HTMLGetLanguage'
+ @@ENDPOINTS['text'] = {}
+ @@ENDPOINTS['text']['url'] = '/url/URLGetText'
+ @@ENDPOINTS['text']['html'] = '/html/HTMLGetText'
+ @@ENDPOINTS['text_raw'] = {}
+ @@ENDPOINTS['text_raw']['url'] = '/url/URLGetRawText'
+ @@ENDPOINTS['text_raw']['html'] = '/html/HTMLGetRawText'
+ @@ENDPOINTS['title'] = {}
+ @@ENDPOINTS['title']['url'] = '/url/URLGetTitle'
+ @@ENDPOINTS['title']['html'] = '/html/HTMLGetTitle'
+ @@ENDPOINTS['feeds'] = {}
+ @@ENDPOINTS['feeds']['url'] = '/url/URLGetFeedLinks'
+ @@ENDPOINTS['feeds']['html'] = '/html/HTMLGetFeedLinks'
+ @@ENDPOINTS['microformats'] = {}
+ @@ENDPOINTS['microformats']['url'] = '/url/URLGetMicroformatData'
+ @@ENDPOINTS['microformats']['html'] = '/html/HTMLGetMicroformatData'
+ @@ENDPOINTS['taxonomy'] = {}
+ @@ENDPOINTS['taxonomy']['url'] = '/url/URLGetRankedTaxonomy'
+ @@ENDPOINTS['taxonomy']['text'] = '/text/TextGetRankedTaxonomy'
+ @@ENDPOINTS['taxonomy']['html'] = '/html/HTMLGetRankedTaxonomy'
+ @@ENDPOINTS['combined'] = {}
+ @@ENDPOINTS['combined']['url'] = '/url/URLGetCombinedData'
+ @@ENDPOINTS['combined']['text'] = '/text/TextGetCombinedData'
+ @@ENDPOINTS['image_extract'] = {}
+ @@ENDPOINTS['image_extract']['url'] = '/url/URLGetImage'
+ @@ENDPOINTS['image_tag'] = {}
+ @@ENDPOINTS['image_tag']['url'] = '/url/URLGetRankedImageKeywords'
+ @@ENDPOINTS['image_tag']['image'] = '/image/ImageGetRankedImageKeywords'
+
+ @@BASE_URL = 'http://access.alchemyapi.com/calls'
+
+
+ def initialize()
+ @apiKey = "08d321a6899cd5f149204b3c687abdb7da81563d"
+ end
+
+ # Calculates the sentiment for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/sentiment-analysis/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/sentiment-analysis/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # showSourceText -> 0: disabled (default), 1: enabled
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def sentiment(flavor, data, options = {})
+ unless @@ENDPOINTS['sentiment'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'sentiment analysis for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['sentiment'][flavor], options)
+ end
+
+
+ # Calculates the targeted sentiment for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/sentiment-analysis/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/sentiment-analysis/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # target -> the word or phrase to run sentiment analysis on.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # showSourceText -> 0: disabled, 1: enabled
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def sentiment_targeted(flavor, data, target, options = {})
+ if target == '' || target == nil
+ return { 'status'=>'ERROR', 'statusMessage'=>'targeted sentiment requires a non-null target' }
+ end
+
+ unless @@ENDPOINTS['sentiment_targeted'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'targeted sentiment analysis for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data and the target to the options and analyze
+ options[flavor] = data
+ options['target'] = target
+ return analyze(@@ENDPOINTS['sentiment_targeted'][flavor], options)
+ end
+
+
+ # Extracts the entities for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/entity-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/entity-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # disambiguate -> disambiguate entities (i.e. Apple the company vs. apple the fruit). 0: disabled, 1: enabled (default)
+ # linkedData -> include linked data on disambiguated entities. 0: disabled, 1: enabled (default)
+ # coreference -> resolve coreferences (i.e. the pronouns that correspond to named entities). 0: disabled, 1: enabled (default)
+ # quotations -> extract quotations by entities. 0: disabled (default), 1: enabled.
+ # sentiment -> analyze sentiment for each entity. 0: disabled (default), 1: enabled. Requires 1 additional API transction if enabled.
+ # showSourceText -> 0: disabled (default), 1: enabled
+ # maxRetrieve -> the maximum number of entities to retrieve (default: 50)
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def entities(flavor, data, options = {})
+ unless @@ENDPOINTS['entities'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'entity extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['entities'][flavor], options)
+ end
+
+
+ # Extracts the author from a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/author-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/author-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # none
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def author(flavor, data, options = {})
+ unless @@ENDPOINTS['author'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'author extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['author'][flavor], options)
+ end
+
+
+ # Extracts the keywords from text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/keyword-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/keyword-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # keywordExtractMode -> normal (default), strict
+ # sentiment -> analyze sentiment for each keyword. 0: disabled (default), 1: enabled. Requires 1 additional API transaction if enabled.
+ # showSourceText -> 0: disabled (default), 1: enabled.
+ # maxRetrieve -> the max number of keywords returned (default: 50)
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def keywords(flavor, data, options = {})
+ unless @@ENDPOINTS['keywords'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'keyword extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['keywords'][flavor], options)
+ end
+
+
+ # Tags the concepts for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/concept-tagging/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/concept-tagging/
+ #
+ # Available Options:
+ # maxRetrieve -> the maximum number of concepts to retrieve (default: 8)
+ # linkedData -> include linked data, 0: disabled, 1: enabled (default)
+ # showSourceText -> 0:disabled (default), 1: enabled
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def concepts(flavor, data, options = {})
+ unless @@ENDPOINTS['concepts'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'concept tagging for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['concepts'][flavor], options)
+ end
+
+
+ # Categorizes the text for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/text-categorization/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/text-categorization/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # showSourceText -> 0: disabled (default), 1: enabled
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def category(flavor, data, options = {})
+ unless @@ENDPOINTS['category'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'text categorization for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['category'][flavor], options)
+ end
+
+
+ # Extracts the relations for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/relation-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/relation-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # sentiment -> 0: disabled (default), 1: enabled. Requires one additional API transaction if enabled.
+ # keywords -> extract keywords from the subject and object. 0: disabled (default), 1: enabled. Requires one additional API transaction if enabled.
+ # entities -> extract entities from the subject and object. 0: disabled (default), 1: enabled. Requires one additional API transaction if enabled.
+ # requireEntities -> only extract relations that have entities. 0: disabled (default), 1: enabled.
+ # sentimentExcludeEntities -> exclude full entity name in sentiment analysis. 0: disabled, 1: enabled (default)
+ # disambiguate -> disambiguate entities (i.e. Apple the company vs. apple the fruit). 0: disabled, 1: enabled (default)
+ # linkedData -> include linked data with disambiguated entities. 0: disabled, 1: enabled (default).
+ # coreference -> resolve entity coreferences. 0: disabled, 1: enabled (default)
+ # showSourceText -> 0: disabled (default), 1: enabled.
+ # maxRetrieve -> the maximum number of relations to extract (default: 50, max: 100)
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def relations(flavor, data, options = {})
+ unless @@ENDPOINTS['relations'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'relation extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['relations'][flavor], options)
+ end
+
+
+ # Detects the language for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/api/language-detection/
+ # For the docs, please refer to: http://www.alchemyapi.com/products/features/language-detection/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # none
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def language(flavor, data, options = {})
+ unless @@ENDPOINTS['language'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'language detection for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['language'][flavor], options)
+ end
+
+
+ # Extracts the cleaned text (removes ads, navigation, etc.) for text, a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/text-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/text-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # useMetadata -> utilize meta description data, 0: disabled, 1: enabled (default)
+ # extractLinks -> include links, 0: disabled (default), 1: enabled.
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def text(flavor, data, options = {})
+ unless @@ENDPOINTS['text'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'clean text extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['text'][flavor], options)
+ end
+
+
+ # Extracts the raw text (includes ads, navigation, etc.) for a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/text-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/text-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # none
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def text_raw(flavor, data, options = {})
+ unless @@ENDPOINTS['text_raw'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'raw text extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['text_raw'][flavor], options)
+ end
+
+
+ # Extracts the title for a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/text-extraction/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/text-extraction/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. text, url or html.
+ # data -> the data to analyze, either the text, the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # useMetadata -> utilize title info embedded in meta data, 0: disabled, 1: enabled (default)
+
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def title(flavor, data, options = {})
+ unless @@ENDPOINTS['title'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'title extraction for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['title'][flavor], options)
+ end
+
+
+ # Parses the microformats for a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/microformats-parsing/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/microformats-parsing/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url or html.
+ # data -> the data to analyze, either the the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # none
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def microformats(flavor, data, options = {})
+ unless @@ENDPOINTS['microformats'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'microformats parsing for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['microformats'][flavor], options)
+ end
+
+
+ # Detects the RSS/ATOM feeds for a URL or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/feed-detection/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/feed-detection/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url or html.
+ # data -> the data to analyze, either the the url or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # none
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def feeds(flavor, data, options = {})
+ unless @@ENDPOINTS['feeds'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'feed detection for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['feeds'][flavor], options)
+ end
+
+
+ # Categorizes the text for a URL, text or HTML.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/text-categorization/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/taxonomy/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url, text or html.
+ # data -> the data to analyze, either the the url, text or html code.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # showSourceText -> 0: disabled (default), 1: enabled.
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def taxonomy(flavor, data, options = {})
+ unless @@ENDPOINTS['taxonomy'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'Taxonomy info for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['taxonomy'][flavor], options)
+ end
+
+
+ # Combined call (see options below for available extractions) for a URL or text.
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url or text.
+ # data -> the data to analyze, either the the url or text.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # extract -> VALUE,VALUE,VALUE,... (possible VALUEs: page-image,entity,keyword,title,author,taxonomy,concept,relation,doc-sentiment)
+ # extractMode -> (only applies when 'page-image' VALUE passed to 'extract' option)
+ # trust-metadata: less CPU-intensive, less accurate
+ # always-infer: more CPU-intensive, more accurate
+ # disambiguate -> whether to disambiguate detected entities, 0: disabled, 1: enabled (default)
+ # linkedData -> whether to include Linked Data content links with disambiguated entities, 0: disabled, 1: enabled (default). disambiguate must be enabled to use this.
+ # coreference -> whether to he/she/etc coreferences into detected entities, 0: disabled, 1: enabled (default)
+ # quotations -> whether to enable quotations extraction, 0: disabled (default), 1: enabled
+ # sentiment -> whether to enable entity-level sentiment analysis, 0: disabled (default), 1: enabled. Requires one additional API transaction if enabled.
+ # showSourceText -> 0: disabled (default), 1: enabled.
+ # maxRetrieve -> maximum number of named entities to extract (default: 50)
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def combined(flavor, data, options = {})
+ unless @@ENDPOINTS['combined'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'Combined data for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['combined'][flavor], options)
+ end
+
+
+ # Extract image from a URL.
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url.
+ # data -> the data to analyze, i.e. the url.
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # extractMode -> trust-metadata: less CPU-intensive and less accurate, always-infer: more CPU-intensive and more accurate
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def image_extract(flavor, data, options = {})
+ unless @@ENDPOINTS['image_extract'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'Image for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ options[flavor] = data
+ return analyze(@@ENDPOINTS['image_extract'][flavor], options)
+ end
+
+
+ # Tag image from a URL or raw image data.
+ # For an overview, please refer to: http://www.alchemyapi.com/products/features/image-tagging/
+ # For the docs, please refer to: http://www.alchemyapi.com/api/image-tagging/
+ #
+ # INPUT:
+ # flavor -> which version of the call, i.e. url or image.
+ # data -> the data to analyze, the url
+ # options -> various parameters that can be used to adjust how the API works, see below for more info on the available options.
+ #
+ # Available Options:
+ # extractMode -> trust-metadata: less CPU-intensive and less accurate, always-infer: more CPU-intensive and more accurate
+ # (image flavor only)
+ # imagePostMode -> how you will post the image
+ # raw: pass an unencoded image file using POST
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def image_tag(flavor, data, options = {}, image = '')
+ unless @@ENDPOINTS['image_tag'].key?(flavor)
+ return { 'status'=>'ERROR', 'statusInfo'=>'Image tagging for ' + flavor + ' not available' }
+ end
+
+ #Add the URL encoded data to the options and analyze
+ unless data.empty?
+ options[flavor] = data
+ end
+ return analyze_image(@@ENDPOINTS['image_tag'][flavor], options, image)
+ end
+
+
+ private
+
+ # HTTP Request wrapper that is called by the endpoint functions. This function is not intended to be called through an external interface.
+ # It makes the call, then converts the returned JSON string into a Ruby object.
+ #
+ # INPUT:
+ # url -> the full URI encoded url
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def analyze(url, options)
+
+ #Insert the base URL
+ url = @@BASE_URL + url
+
+ #Add the API key and set the output mode to JSON
+ options['apikey'] = @apiKey
+ options['outputMode'] = 'json'
+
+ uri = URI.parse(url)
+ request = Net::HTTP::Post.new(uri.request_uri)
+ request.set_form_data(options)
+
+ # disable gzip encoding which blows up in Zlib due to Ruby 2.0 bug
+ # otherwise you'll get Zlib::BufError: buffer error
+ request['Accept-Encoding'] = 'identity'
+
+ #Fire off the HTTP request
+ res = Net::HTTP.start(uri.host, uri.port) do |http|
+ http.request(request)
+ end
+
+ #parse and return the response
+ return JSON.parse(res.body)
+ end
+
+ # HTTP Request wrapper that is called by the endpoint functions. This function is not intended to be called through an external interface.
+ # It makes the call, then converts the returned JSON string into a Ruby object.
+ #
+ # INPUT:
+ # url -> the full URI encoded url
+ # body -> the raw binary image data
+ #
+ # OUTPUT:
+ # The response, already converted from JSON to a Ruby object.
+ #
+ def analyze_image(url, options, body)
+
+ #Insert the base URL
+ url = @@BASE_URL + url
+
+ #Add the API key and set the output mode to JSON
+ options['apikey'] = @apiKey
+ options['outputMode'] = 'json'
+
+ url += '?'
+ options.each { |h,v|
+ url += h + '=' + v + '&'
+ }
+
+ #Parse URL
+ uri = URI.parse(url)
+
+ request = Net::HTTP::Post.new(uri.request_uri)
+ request.body = body.to_s
+
+ # disable gzip encoding which blows up in Zlib due to Ruby 2.0 bug
+ # otherwise you'll get Zlib::BufError: buffer error
+ request['Accept-Encoding'] = 'identity'
+
+ #Fire off the HTTP request
+ res = Net::HTTP.start(uri.host, uri.port) do |http|
+ http.request(request)
+ end
+
+ #parse and return the response
+ return JSON.parse(res.body)
+ end
+end
+
+
+
+# Writes the API key to api_key.txt file. It will create the file if it doesn't exist.
+# This function is intended to be called from the Python command line using: python -c 'import alchemyapi;alchemyapi.setkey("API_KEY");'
+# If you don't have an API key yet, register for one at: http://www.alchemyapi.com/api/register.html
+#
+# INPUT:
+# key -> Your API key from Should be 40 hex characters
+#
+# OUTPUT:
+# none
+#
+
+if __FILE__==$0
+ # this will only run if the script was the main, not load'd or require'd
+ if ARGV.length == 1
+ if (ARGV[0].length == 40)
+ puts 'Key: ' + ARGV[0] + ' was written to api_key.txt'
+ puts 'You are now ready to start using AlchemyAPI. For an example, run: ruby example.rb'
+ File.open('api_key.txt','w') {|f| f.write(ARGV[0]) }
+ else
+ puts 'The key appears to invalid. Please make sure to use the 40 character key assigned by AlchemyAPI'
+ end
+ end
+
+end
+
+
diff --git a/log/development.log b/log/development.log
index df9fe26..97ac0e7 100644
--- a/log/development.log
+++ b/log/development.log
@@ -349,3 +349,648 @@ Started GET "/reuters/competitors.xml?name=IBM" for 127.0.0.1 at 2015-12-17 14:5
Processing by ReutersController#competitors as XML
Parameters: {"name"=>"IBM"}
Completed 200 OK in 344.7ms (Views: 0.2ms)
+
+
+Started GET "/" for 127.0.0.1 at 2015-12-18 11:14:23 +0100
+Processing by SayController#hello as HTML
+ Rendered say/hello.html.erb within layouts/application (1.2ms)
+Compiled reuters.js (502ms) (pid 7646)
+Compiled application.js (508ms) (pid 7646)
+Completed 200 OK in 546.9ms (Views: 545.3ms)
+
+
+Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2015-12-18 11:14:24 +0100
+Served asset /jquery.js - 200 OK (4ms)
+
+
+Started GET "/assets/reuters.js?body=1" for 127.0.0.1 at 2015-12-18 11:14:24 +0100
+Served asset /reuters.js - 200 OK (1ms)
+
+
+Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2015-12-18 11:14:24 +0100
+Served asset /application.js - 200 OK (6ms)
+
+
+Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2015-12-18 11:14:24 +0100
+Served asset /jquery_ujs.js - 200 OK (2ms)
+
+
+Started GET "/assets/newapp-icon.png" for 127.0.0.1 at 2015-12-18 11:14:24 +0100
+Served asset /newapp-icon.png - 200 OK (1ms)
+
+
+Started GET "/reuters/find.json" for 127.0.0.1 at 2015-12-18 11:14:25 +0100
+
+LoadError (cannot load such file -- ./alchemyapi.rb):
+ app/controllers/reuters_controller.rb:4:in `'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.1ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.6ms)
+
+
+Started GET "/reuters/find.json" for 127.0.0.1 at 2015-12-18 11:16:34 +0100
+
+AbstractController::ActionNotFound (The action 'find' could not be found for ReutersController):
+ actionpack (3.2.22) lib/abstract_controller/base.rb:116:in `process'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:45:in `process'
+ actionpack (3.2.22) lib/action_controller/metal.rb:203:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal.rb:246:in `block in action'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:36:in `call'
+ journey (1.0.4) lib/journey/router.rb:68:in `block in call'
+ journey (1.0.4) lib/journey/router.rb:56:in `each'
+ journey (1.0.4) lib/journey/router.rb:56:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:608:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
+ rack (1.4.7) lib/rack/etag.rb:23:in `call'
+ rack (1.4.7) lib/rack/conditionalget.rb:25:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/head.rb:14:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/flash.rb:242:in `call'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:210:in `context'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:205:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/cookies.rb:341:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `_run__4365342780757090972__call__2074859840428225406__callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/reloader.rb:65:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
+ railties (3.2.22) lib/rails/rack/logger.rb:32:in `call_app'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `block in call'
+ activesupport (3.2.22) lib/active_support/tagged_logging.rb:22:in `tagged'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/request_id.rb:22:in `call'
+ rack (1.4.7) lib/rack/methodoverride.rb:21:in `call'
+ rack (1.4.7) lib/rack/runtime.rb:17:in `call'
+ activesupport (3.2.22) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
+ rack (1.4.7) lib/rack/lock.rb:15:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/static.rb:83:in `call'
+ railties (3.2.22) lib/rails/engine.rb:484:in `call'
+ railties (3.2.22) lib/rails/application.rb:231:in `call'
+ rack (1.4.7) lib/rack/content_length.rb:14:in `call'
+ railties (3.2.22) lib/rails/rack/log_tailer.rb:17:in `call'
+ rack (1.4.7) lib/rack/handler/webrick.rb:59:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb within rescues/layout (1.7ms)
+
+
+Started GET "/reuters/test.json" for 127.0.0.1 at 2015-12-18 11:16:41 +0100
+Processing by ReutersController#test as JSON
+Completed 500 Internal Server Error in 397.5ms
+
+ActionView::MissingTemplate (Missing template reuters/test, application/test with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :coffee]}. Searched in:
+ * "/Users/rackom/Downloads/reuters-api/app/views"
+):
+ actionpack (3.2.22) lib/action_view/path_set.rb:58:in `find'
+ actionpack (3.2.22) lib/action_view/lookup_context.rb:122:in `find'
+ actionpack (3.2.22) lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
+ actionpack (3.2.22) lib/action_view/renderer/template_renderer.rb:34:in `determine_template'
+ actionpack (3.2.22) lib/action_view/renderer/template_renderer.rb:10:in `render'
+ actionpack (3.2.22) lib/action_view/renderer/renderer.rb:36:in `render_template'
+ actionpack (3.2.22) lib/action_view/renderer/renderer.rb:17:in `render'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:110:in `_render_template'
+ actionpack (3.2.22) lib/action_controller/metal/streaming.rb:225:in `_render_template'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:103:in `render_to_body'
+ actionpack (3.2.22) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
+ actionpack (3.2.22) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:88:in `render'
+ actionpack (3.2.22) lib/action_controller/metal/rendering.rb:16:in `render'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
+ activesupport (3.2.22) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
+ activesupport (3.2.22) lib/active_support/core_ext/benchmark.rb:5:in `ms'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:39:in `render'
+ actionpack (3.2.22) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
+ actionpack (3.2.22) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
+ actionpack (3.2.22) lib/abstract_controller/base.rb:167:in `process_action'
+ actionpack (3.2.22) lib/action_controller/metal/rendering.rb:10:in `process_action'
+ actionpack (3.2.22) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:414:in `_run__3437956240699482527__process_action__1722722184011545041__callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
+ actionpack (3.2.22) lib/abstract_controller/callbacks.rb:17:in `process_action'
+ actionpack (3.2.22) lib/action_controller/metal/rescue.rb:29:in `process_action'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
+ activesupport (3.2.22) lib/active_support/notifications.rb:123:in `block in instrument'
+ activesupport (3.2.22) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
+ activesupport (3.2.22) lib/active_support/notifications.rb:123:in `instrument'
+ actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
+ actionpack (3.2.22) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
+ actionpack (3.2.22) lib/abstract_controller/base.rb:121:in `process'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:45:in `process'
+ actionpack (3.2.22) lib/action_controller/metal.rb:203:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal.rb:246:in `block in action'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:36:in `call'
+ journey (1.0.4) lib/journey/router.rb:68:in `block in call'
+ journey (1.0.4) lib/journey/router.rb:56:in `each'
+ journey (1.0.4) lib/journey/router.rb:56:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:608:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
+ rack (1.4.7) lib/rack/etag.rb:23:in `call'
+ rack (1.4.7) lib/rack/conditionalget.rb:25:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/head.rb:14:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/flash.rb:242:in `call'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:210:in `context'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:205:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/cookies.rb:341:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `_run__4365342780757090972__call__2074859840428225406__callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/reloader.rb:65:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
+ railties (3.2.22) lib/rails/rack/logger.rb:32:in `call_app'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `block in call'
+ activesupport (3.2.22) lib/active_support/tagged_logging.rb:22:in `tagged'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/request_id.rb:22:in `call'
+ rack (1.4.7) lib/rack/methodoverride.rb:21:in `call'
+ rack (1.4.7) lib/rack/runtime.rb:17:in `call'
+ activesupport (3.2.22) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
+ rack (1.4.7) lib/rack/lock.rb:15:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/static.rb:83:in `call'
+ railties (3.2.22) lib/rails/engine.rb:484:in `call'
+ railties (3.2.22) lib/rails/application.rb:231:in `call'
+ rack (1.4.7) lib/rack/content_length.rb:14:in `call'
+ railties (3.2.22) lib/rails/rack/log_tailer.rb:17:in `call'
+ rack (1.4.7) lib/rack/handler/webrick.rb:59:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/missing_template.erb within rescues/layout (0.4ms)
+
+
+Started GET "/reuters/test.json" for 127.0.0.1 at 2015-12-18 11:16:52 +0100
+Processing by ReutersController#test as JSON
+Completed 406 Not Acceptable in 365.6ms
+
+
+Started GET "/reuters/test.json" for 127.0.0.1 at 2015-12-18 11:16:56 +0100
+Processing by ReutersController#test as JSON
+Completed 406 Not Acceptable in 380.0ms
+
+
+Started GET "/reuters/test.xml" for 127.0.0.1 at 2015-12-18 11:16:57 +0100
+Processing by ReutersController#test as XML
+Completed 200 OK in 562.5ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml" for 127.0.0.1 at 2015-12-18 11:17:10 +0100
+Processing by ReutersController#test as XML
+Completed 200 OK in 420.9ms (Views: 0.1ms)
+
+
+Started GET "/" for 127.0.0.1 at 2015-12-18 11:35:58 +0100
+Processing by SayController#hello as HTML
+ Rendered say/hello.html.erb within layouts/application (0.4ms)
+Completed 200 OK in 22.5ms (Views: 21.5ms)
+
+
+Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2015-12-18 11:35:58 +0100
+Served asset /jquery.js - 200 OK (4ms)
+
+
+Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2015-12-18 11:35:58 +0100
+Served asset /application.js - 200 OK (3ms)
+
+
+Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2015-12-18 11:35:58 +0100
+Served asset /jquery_ujs.js - 200 OK (1ms)
+
+
+Started GET "/reuters/find.json" for 127.0.0.1 at 2015-12-18 11:36:01 +0100
+
+AbstractController::ActionNotFound (The action 'find' could not be found for ReutersController):
+ actionpack (3.2.22) lib/abstract_controller/base.rb:116:in `process'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:45:in `process'
+ actionpack (3.2.22) lib/action_controller/metal.rb:203:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal.rb:246:in `block in action'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:36:in `call'
+ journey (1.0.4) lib/journey/router.rb:68:in `block in call'
+ journey (1.0.4) lib/journey/router.rb:56:in `each'
+ journey (1.0.4) lib/journey/router.rb:56:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:608:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
+ rack (1.4.7) lib/rack/etag.rb:23:in `call'
+ rack (1.4.7) lib/rack/conditionalget.rb:25:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/head.rb:14:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/flash.rb:242:in `call'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:210:in `context'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:205:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/cookies.rb:341:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `_run__4365342780757090972__call__2074859840428225406__callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/reloader.rb:65:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
+ railties (3.2.22) lib/rails/rack/logger.rb:32:in `call_app'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `block in call'
+ activesupport (3.2.22) lib/active_support/tagged_logging.rb:22:in `tagged'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/request_id.rb:22:in `call'
+ rack (1.4.7) lib/rack/methodoverride.rb:21:in `call'
+ rack (1.4.7) lib/rack/runtime.rb:17:in `call'
+ activesupport (3.2.22) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
+ rack (1.4.7) lib/rack/lock.rb:15:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/static.rb:83:in `call'
+ railties (3.2.22) lib/rails/engine.rb:484:in `call'
+ railties (3.2.22) lib/rails/application.rb:231:in `call'
+ rack (1.4.7) lib/rack/content_length.rb:14:in `call'
+ railties (3.2.22) lib/rails/rack/log_tailer.rb:17:in `call'
+ rack (1.4.7) lib/rack/handler/webrick.rb:59:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb within rescues/layout (0.4ms)
+
+
+Started GET "/reuters/test.xml" for 127.0.0.1 at 2015-12-18 11:36:11 +0100
+Processing by ReutersController#test as XML
+Completed 500 Internal Server Error in 1013.3ms
+
+OpenURI::HTTPError (500 Internal Server Error):
+ app/controllers/reuters_controller.rb:40:in `fetch_element_by_css'
+ app/controllers/reuters_controller.rb:56:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (21.8ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:36:18 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 1051.0ms
+
+TypeError (no implicit conversion of Nokogiri::XML::NodeSet into String):
+ app/controllers/reuters_controller.rb:47:in `+'
+ app/controllers/reuters_controller.rb:47:in `highlight'
+ app/controllers/reuters_controller.rb:58:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (17.5ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:37:03 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 616.8ms (Views: 1.3ms)
+
+
+Started GET "/" for 127.0.0.1 at 2015-12-18 11:37:56 +0100
+Processing by SayController#hello as HTML
+ Rendered say/hello.html.erb within layouts/application (0.0ms)
+Completed 200 OK in 6.3ms (Views: 5.1ms)
+
+
+Started GET "/reuters/" for 127.0.0.1 at 2015-12-18 11:38:01 +0100
+
+AbstractController::ActionNotFound (The action 'index' could not be found for ReutersController):
+ actionpack (3.2.22) lib/abstract_controller/base.rb:116:in `process'
+ actionpack (3.2.22) lib/abstract_controller/rendering.rb:45:in `process'
+ actionpack (3.2.22) lib/action_controller/metal.rb:203:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
+ actionpack (3.2.22) lib/action_controller/metal.rb:246:in `block in action'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:36:in `call'
+ journey (1.0.4) lib/journey/router.rb:68:in `block in call'
+ journey (1.0.4) lib/journey/router.rb:56:in `each'
+ journey (1.0.4) lib/journey/router.rb:56:in `call'
+ actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:608:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
+ rack (1.4.7) lib/rack/etag.rb:23:in `call'
+ rack (1.4.7) lib/rack/conditionalget.rb:25:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/head.rb:14:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/flash.rb:242:in `call'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:210:in `context'
+ rack (1.4.7) lib/rack/session/abstract/id.rb:205:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/cookies.rb:341:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `_run__4365342780757090972__call__2074859840428225406__callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
+ activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
+ actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/reloader.rb:65:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
+ railties (3.2.22) lib/rails/rack/logger.rb:32:in `call_app'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `block in call'
+ activesupport (3.2.22) lib/active_support/tagged_logging.rb:22:in `tagged'
+ railties (3.2.22) lib/rails/rack/logger.rb:16:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/request_id.rb:22:in `call'
+ rack (1.4.7) lib/rack/methodoverride.rb:21:in `call'
+ rack (1.4.7) lib/rack/runtime.rb:17:in `call'
+ activesupport (3.2.22) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
+ rack (1.4.7) lib/rack/lock.rb:15:in `call'
+ actionpack (3.2.22) lib/action_dispatch/middleware/static.rb:83:in `call'
+ railties (3.2.22) lib/rails/engine.rb:484:in `call'
+ railties (3.2.22) lib/rails/application.rb:231:in `call'
+ rack (1.4.7) lib/rack/content_length.rb:14:in `call'
+ railties (3.2.22) lib/rails/rack/log_tailer.rb:17:in `call'
+ rack (1.4.7) lib/rack/handler/webrick.rb:59:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
+ /Users/rackom/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb within rescues/layout (0.4ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:38:02 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 658.8ms
+
+NoMethodError (undefined method `strip' for #):
+ app/controllers/reuters_controller.rb:47:in `highlight'
+ app/controllers/reuters_controller.rb:58:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.5ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:38:15 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 285.1ms
+
+NoMethodError (undefined method `content' for #):
+ app/controllers/reuters_controller.rb:58:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.3ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (21.9ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:40:39 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 1291.5ms
+
+NoMethodError (undefined method `strip' for #):
+ app/controllers/reuters_controller.rb:47:in `highlight'
+ app/controllers/reuters_controller.rb:58:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.2ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:41:56 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1229.8ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:42:03 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 325.5ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:43:07 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1302.2ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:43:11 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 405.5ms (Views: 0.3ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:43:52 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 420.1ms
+
+NoMethodError (undefined method `gsub' for #):
+ app/controllers/reuters_controller.rb:61:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.6ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:44:02 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 377.7ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:44:06 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 321.2ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:44:25 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 2027.6ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:45:49 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1085.0ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:47:42 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 631.1ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:51:35 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1165.8ms (Views: 0.3ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:52:22 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 614.2ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:58:34 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 500 Internal Server Error in 437.1ms
+
+NameError (undefined local variable or method `text' for #):
+ app/controllers/reuters_controller.rb:61:in `test'
+
+
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_trace.erb (4.0ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
+ Rendered /Users/rackom/.rvm/gems/ruby-2.2.2/gems/actionpack-3.2.22/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (23.7ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:58:53 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 871.6ms (Views: 0.2ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 11:59:05 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1138.8ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 12:06:14 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 2045.8ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 12:07:09 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 1581.7ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 12:07:36 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 2028.4ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test.xml?name=IBM" for 127.0.0.1 at 2015-12-18 12:10:29 +0100
+Processing by ReutersController#test as XML
+ Parameters: {"name"=>"IBM"}
+Completed 200 OK in 2324.1ms (Views: 0.1ms)
+
+
+Started GET "/reuters/test?name=IBM" for 127.0.0.1 at 2015-12-18 12:10:37 +0100
+Processing by ReutersController#test as HTML
+ Parameters: {"name"=>"IBM"}
+Completed 406 Not Acceptable in 819.6ms
+
+
+Started GET "/reuters/test?name=IBM" for 127.0.0.1 at 2015-12-18 12:11:22 +0100
+Processing by ReutersController#test as HTML
+ Parameters: {"name"=>"IBM"}
+ Rendered reuters/test.html.erb within layouts/application (0.4ms)
+Completed 200 OK in 4515.7ms (Views: 6.2ms)
+
+
+Started GET "/reuters/test?name=IBM" for 127.0.0.1 at 2015-12-18 12:11:48 +0100
+Processing by ReutersController#test as HTML
+ Parameters: {"name"=>"IBM"}
+ Rendered reuters/test.html.erb within layouts/application (1.5ms)
+Completed 200 OK in 2279.5ms (Views: 16.0ms)
+
+
+Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:50 +0100
+Served asset /jquery.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:50 +0100
+Served asset /jquery_ujs.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:50 +0100
+Served asset /application.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/reuters.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:50 +0100
+Served asset /reuters.js - 304 Not Modified (5ms)
+
+
+Started GET "/reuters/test?name=IBM" for 127.0.0.1 at 2015-12-18 12:11:57 +0100
+Processing by ReutersController#test as HTML
+ Parameters: {"name"=>"IBM"}
+ Rendered reuters/test.html.erb within layouts/application (0.4ms)
+Completed 200 OK in 1162.8ms (Views: 3.9ms)
+
+
+Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:58 +0100
+Served asset /jquery.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:58 +0100
+Served asset /jquery_ujs.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:58 +0100
+Served asset /application.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/reuters.js?body=1" for 127.0.0.1 at 2015-12-18 12:11:58 +0100
+Served asset /reuters.js - 304 Not Modified (0ms)
+
+
+Started GET "/reuters/test?name=AAPL" for 127.0.0.1 at 2015-12-18 12:12:07 +0100
+Processing by ReutersController#test as HTML
+ Parameters: {"name"=>"AAPL"}
+ Rendered reuters/test.html.erb within layouts/application (0.0ms)
+Completed 200 OK in 6369.7ms (Views: 3.4ms)
+
+
+Started GET "/assets/reuters.js?body=1" for 127.0.0.1 at 2015-12-18 12:12:13 +0100
+Served asset /reuters.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2015-12-18 12:12:13 +0100
+Served asset /jquery_ujs.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2015-12-18 12:12:13 +0100
+Served asset /application.js - 304 Not Modified (0ms)
+
+
+Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2015-12-18 12:12:13 +0100
+Served asset /jquery.js - 304 Not Modified (0ms)
diff --git a/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 b/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
index c8d8686..8889c85 100644
Binary files a/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 and b/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 differ
diff --git a/tmp/cache/assets/DAD/810/sprockets%2F57de31f7a03c6403e1c03aab0fc4cbd1 b/tmp/cache/assets/DAD/810/sprockets%2F57de31f7a03c6403e1c03aab0fc4cbd1
new file mode 100644
index 0000000..440f61f
Binary files /dev/null and b/tmp/cache/assets/DAD/810/sprockets%2F57de31f7a03c6403e1c03aab0fc4cbd1 differ
diff --git a/tmp/cache/assets/DC7/D40/sprockets%2F88b60beeb6cbaa184f2e07b91cc190d7 b/tmp/cache/assets/DC7/D40/sprockets%2F88b60beeb6cbaa184f2e07b91cc190d7
new file mode 100644
index 0000000..91e664f
Binary files /dev/null and b/tmp/cache/assets/DC7/D40/sprockets%2F88b60beeb6cbaa184f2e07b91cc190d7 differ
diff --git a/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 b/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
index 4886542..709bf74 100644
Binary files a/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 and b/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 differ
diff --git a/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af b/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
index 9328cd3..25000a0 100644
Binary files a/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af and b/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af differ
diff --git a/tmp/pids/server.pid b/tmp/pids/server.pid
new file mode 100644
index 0000000..7fc34fa
--- /dev/null
+++ b/tmp/pids/server.pid
@@ -0,0 +1 @@
+7971
\ No newline at end of file