Class: Namesies::Twitter
- Inherits:
-
Object
- Object
- Namesies::Twitter
- Defined in:
- lib/namesies/twitter.rb
Class Method Summary collapse
Class Method Details
.search(query) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/namesies/twitter.rb', line 6 def self.search(query) reporter = Namesies::Reporter.new('Twitter') response = Net::HTTP.get_response(URI("https://twitter.com/#{query}")) case response.code when "404" reporter.result "@#{query} available", 'green' when "200" reporter.result "@#{query} unavailable", 'red' else reporter.result "something's wrong with twitter :(" end end |