Skip to content

Instantly share code, notes, and snippets.

@novemberkilo
Created May 8, 2010 01:05
Snippet to demonstrate the usage of flickraw to get recent activity on a photostream. Assumes that the user is authenticated.
recent_activity = flickr.activity.userPhotos(:timeframe => timeframe)
recent_activity.each do |x|
message = ''
x.activity.event.each do |z|
case
when z.type == "comment" then
begin
unless @displayed_comments.include? z.commentid
@displayed_comments.push z.commentid
message << "Comment: " << z._content << "\n"
end
end
when z.type == "fave" then
message << "Added as a favorite\n"
end
unless (message == '')
message << "User: " << z.username << "\n"
time_added = Time.at(z.dateadded.to_i)
message << time_added.to_s << "\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment