Sha256: e0d0c686d560b887a0ed6d80cb25bd97fc74d7d9c8a0ef2e511a2233a0293685

Contents?: true

Size: 365 Bytes

Versions: 5

Compression:

Stored size: 365 Bytes

Contents

class Verification
  attr_accessor :user_name

  def initialize(user_name)
    @user_name = user_name.gsub(' ', '%20')
  end

  def verify
    html = open("https://twitter.com/#{self.user_name}")
    rescue OpenURI::HTTPError => error
    response = error.io
    if !response.status.include?("404" || "Not Found")
      true
    else
      false
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
twiterator-0.2.3 lib/twiterator/verification.rb
twiterator-0.2.2 lib/twiterator/verification.rb
twiterator-0.2.1 lib/twiterator/verification.rb
twiterator-0.2.0 lib/twiterator/verification.rb
twiterator-0.1.0 lib/twiterator/verification.rb