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