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