Sha256: 9d37cdd82493732593e91407055dff551995a6e500ece8ca425d3de8cf411ecb

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

module Twitterland
  class TweetBlocker
    include HTTParty
    base_uri 'http://tweetblocker.com/api'
    format :json

    # Get grade for user
    #
    #   Twitterland::TweetBlocker.user('bradleyjoyce')
    def self.user(username)
      @result ||= Mash.new(self.get("/username/#{username}.json")).user
    end
    
    # Report user as spammer
    #
    #   Twitterland::TweetBlocker.spam('leetspeeker39203959230390235')
    def self.report_spam(username)
      status = Mash.new(self.get("/spam/#{username}.json"))
      status['error'].blank? ? status : status['error']
    end
    
    
    # Check API rate limiting
    #
    #   Twitterland::TweetBlocker.rate_limit
    def self.rate_limit
      @rate_limit = Mash.new(self.get("/user/rate_limit_status.json"))
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
squeejee-twitterland-0.2.0 lib/twitterland/tweet_blocker.rb
twitterland-0.2.0 lib/twitterland/tweet_blocker.rb