Guest User

Untitled

a guest
Dec 12th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.33 KB | None | 0 0
  1. require 'sinatra'
  2. require 'twitter'
  3.  
  4. get '/' do
  5.  
  6.   # Assign the parameter value of `query` to the instance variable `@query`
  7.   @query = params['query']
  8.  
  9.   client = Twitter::Client.new
  10.   tweet_container = client.search(@query)
  11.   @tweets = tweet_container.results
  12.  
  13.   erb :index
  14. end
  15.  
  16. get '/about_me' do
  17.   erb :about_me
  18. end
Add Comment
Please, Sign In to add comment