I'm working on an awareness campaign for a nonprofit. We're asking people to upload photos of them holding a sign to the nonprofit's Facebook page. Since they don't show clearly on the timeline, we want to scrape these photos and display them on a page on the nonprofit's website.
Getting all the photos is easy. I'm using the following FQL to get them:
SELECT post_id, actor_id, message, attachment, place, created_time
FROM stream WHERE source_id = PAGE_ID and source_id <> actor_id
AND attachment.media <> '' AND created_time > 1338834720
LIMIT 50
The problem is, there are other photos that people are uploading to the website that we don't want featured in this gallery. What I'd like to do is further filter this result set so we only get photos the page or a page admin has liked or commented on. This is where I'm getting stuck.
When I convert this to a multi-query and feed the results of the query above into:
SELECT post_id FROM like WHERE user_id = PAGE_ID AND post_id IN (SELECT post_id FROM #query1)
I get an OAuth error that I can only query like for the logged in user. This happens even when authenticating as the app using the PHP SDK.
I've tried getting people to add a text string to their message when they post, but that's not happening. Some people are adding that string to photos the nonprofit doesn't want and the best photos in the nonprofit's eyes don't have that string in them.
Thanks for your help.