Skip to content

Instantly share code, notes, and snippets.

@keade
Created March 9, 2012 00:06
Show Gist options
  • Save keade/2004257 to your computer and use it in GitHub Desktop.
Save keade/2004257 to your computer and use it in GitHub Desktop.
Lost in Twitter Searching
<div class="container">
<div class="row">
<div class="span9">
<h6>@Twitter Name</h6>
<%= form_tag pages_path, method: :get do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", name: nil %>
<% end %>
</div>
<div class="span3">
<h6>recently trucked</h6>
</div>
</div>
</div>
class PagesController < ApplicationController
require 'twitter'
respond_to :json, :html
def index
end
end
class Tweets < Twitter::Status
require 'twitter'
def search
@tweets = Twitter.search('#hashtag', :rpp => 3).map do |status|
"#{status.from_user}: #{status.text}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment