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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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