Sha256: fe2d8c7eebb543e541488bb47a29e55b022896e9218d83779a4985cb191d270a

Contents?: true

Size: 474 Bytes

Versions: 10

Compression:

Stored size: 474 Bytes

Contents

require "social_avatar_proxy/avatar"

module SocialAvatarProxy
  class TwitterAvatar < Avatar
    def remote_url
      if identifier =~ /^\d+$/
        "http://api.twitter.com/1/users/profile_image?user_id=#{identifier}&size=bigger"
      elsif identifier =~ /^[\w\-\.]+$/i
        "http://api.twitter.com/1/users/profile_image?screen_name=#{identifier}&size=bigger"
      else
        raise RuntimeError, "Identifier contains invalid characters"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
social-avatar-proxy-2.0.1 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-2.0.0 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-1.2.0 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-1.1.0 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-1.0.1 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-1.0.0 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-0.0.9 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-0.0.8 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-0.0.7 lib/social_avatar_proxy/twitter_avatar.rb
social-avatar-proxy-0.0.6 lib/social_avatar_proxy/twitter_avatar.rb