Sha256: e061228c5f8dcb14e8d986b513db4416777b977c2625b7dfbb10cb38057168be

Contents?: true

Size: 777 Bytes

Versions: 9

Compression:

Stored size: 777 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)
      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

9 entries across 9 versions & 2 rubygems

Version Path
squeejee-twitterland-0.2.1 lib/twitterland/tweet_blocker.rb
twitterland-0.4.5 lib/twitterland/tweet_blocker.rb
twitterland-0.4.4 lib/twitterland/tweet_blocker.rb
twitterland-0.4.3 lib/twitterland/tweet_blocker.rb
twitterland-0.4.2 lib/twitterland/tweet_blocker.rb
twitterland-0.4.1 lib/twitterland/tweet_blocker.rb
twitterland-0.4.0 lib/twitterland/tweet_blocker.rb
twitterland-0.3.0 lib/twitterland/tweet_blocker.rb
twitterland-0.2.1 lib/twitterland/tweet_blocker.rb