Changeset 35300
- Timestamp:
- 09/10/09 08:02:11 (4 years ago)
- Location:
- platform/tdiary
- Files:
-
- 2 modified
-
plugin/profile.rb (modified) (1 diff)
-
spec/profile_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/plugin/profile.rb
r35297 r35300 145 145 size = @options[:size] ? "?s=#{@options[:size]}" : "" 146 146 "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(@id.downcase)}.jpg#{size}" 147 end 148 end 149 150 class Wassr < Base 151 property :image, '//statuses/status/user/profile_image_url' 152 endpoint {|id| "http://api.wassr.jp/statuses/show.xml?id=#{id}" } 153 154 def link 155 "http://wassr.jp/user/#{id}" 156 end 157 end 158 159 class Hatena < Base 160 def image 161 prefix = id[0..1] 162 "http://www.hatena.ne.jp/users/#{prefix}/#{id}/profile.gif" 163 end 164 165 def link 166 "http://www.hatena.ne.jp/#{id}/" 147 167 end 148 168 end -
platform/tdiary/spec/profile_spec.rb
r35298 r35300 58 58 end 59 59 60 describe "Wassr" do 61 before :all do 62 # http://wassr.jp/help/api 63 @profile = Profile::Service::Wassr.new("machu") 64 end 65 66 it "should include image property" do 67 @profile.image.should == "http://wassr.jp/user/machu/profile_img.png.64.1215127012" 68 end 69 end 70 71 describe "Hatena" do 72 it "should include image property" do 73 profile = Profile::Service::Hatena.new("kmachu") 74 profile.image.should == "http://www.hatena.ne.jp/users/km/kmachu/profile.gif" 75 end 76 end 77 60 78 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)