Created
October 4, 2012 05:38
-
-
Save brundage/3831662 to your computer and use it in GitHub Desktop.
Facebook get mentions (tagged)
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
require 'koala' | |
me = Koala::Facebook::API.new 'AAAC...' # get this from https://developers.facebook.com/tools/explorer - get user_status,manage_pages permissions | |
pages = me.get_connections('me', 'accounts') | |
# Find your page's access token | |
nrb = Koala::Facebook::API.new 'AAAC...' # see acting as a page https://github.com/arsduo/koala/wiki/Acting-as-a-Page | |
feed = nrb.get_connection('me', 'tagged') | |
# Accumulate the feed | |
mentions = feed.select { |p| ! p["message_tags"].nil? } # Sometimes tagged posts don't have tags | |
puts mentions.collect { |m| m["from"]["name"] } | |
# Then check if it is a person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment