Skip to content

Instantly share code, notes, and snippets.

@servidorv
Created November 8, 2012 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save servidorv/4039430 to your computer and use it in GitHub Desktop.
Save servidorv/4039430 to your computer and use it in GitHub Desktop.
push post time to likes
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