15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/butterfly/provider/flickr.rb', line 15
def likes
@likes ||= raw["photos"]["photo"].collect do |raw_like|
Butterfly::Like.new({
:service => "flickr",
:id => raw_like["id"],
:title => raw_like["title"],
:description => raw_like["description"]["_content"],
:created_at => Time.at(raw_like["dateupload"].to_i),
:liked_at => Time.at(raw_like["date_faved"].to_i),
:tags => raw_like["tags"].split(" "),
:photo_url => raw_like["url_sq"],
:url => "http://www.flickr.com/photos/#{raw_like["pathalias"]}/#{raw_like["id"]}/",
:type => "photo",
:user => Butterfly::User.new({
:id => raw_like["owner"],
:username => raw_like["ownername"],
:name => raw_like["ownername"],
:service_url => "http://www.flickr.com/photos/#{raw_like["pathalias"]}/",
:photo_url => nil,
:website_url => nil,
:location => nil,
})
})
end
end
|