Created
November 8, 2012 15:21
-
-
Save servidorv/4039430 to your computer and use it in GitHub Desktop.
push post time to likes
This file contains 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
def extract_likes(posts) | |
u = Array.new | |
posts.each { |post| | |
if post.has_key?("likes") | |
likes = post['likes'] | |
if likes.has_key?("data") | |
users = likes['data'] | |
users.each{|like| | |
like << ['date', post['created_time']] | |
u.push like | |
} | |
end | |
end | |
} | |
return u | |
end | |
Error:undefined method `<<' for {"name"=>"Mario Coletti Bologna", "id"=>"100004027221950"}:Hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment