Sha256: 0cc3f37db549e6d1c4779318c4f6f41c141f8060be7af8a54ef97737628125e5
Contents?: true
Size: 478 Bytes
Versions: 5
Compression:
Stored size: 478 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=original" elsif identifier =~ /^[\w\-\.]+$/i "http://api.twitter.com/1/users/profile_image?screen_name=#{identifier}&size=original" else raise RuntimeError, "Identifier contains invalid characters" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems