From a9a5b3c8497e9fb851f16819530a1cbd98151cee Mon Sep 17 00:00:00 2001 From: Phil Weber Date: Fri, 13 Mar 2015 16:11:17 -0700 Subject: [PATCH] Fixed selector in tweets_controller. Changed formatting in tweets view to improve readability. --- app/controllers/tweets_controller.rb | 2 +- app/views/tweets/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/tweets_controller.rb b/app/controllers/tweets_controller.rb index 1d27be8..689bd9e 100644 --- a/app/controllers/tweets_controller.rb +++ b/app/controllers/tweets_controller.rb @@ -4,7 +4,7 @@ def index response = HTTParty.get('http://twitter.com/newrelic') parsed_data = Nokogiri::HTML.parse response.body - tweetNodes = parsed_data.xpath("//p[@class='js-tweet-text']") + tweetNodes = parsed_data.css(".js-tweet-text") @nodes = tweetNodes.collect do |node| node.inner_html end diff --git a/app/views/tweets/index.html.erb b/app/views/tweets/index.html.erb index 37e4b93..c17193c 100644 --- a/app/views/tweets/index.html.erb +++ b/app/views/tweets/index.html.erb @@ -11,6 +11,6 @@ <% @nodes.each do |node| - %><%= node.html_safe %>
<% + %>

<%= node.html_safe %>

<% end %> \ No newline at end of file