Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created November 30, 2013 06:09
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 marcelcaraciolo/7715921 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/7715921 to your computer and use it in GitHub Desktop.
import urllib.request
import json
def search(texto):
#pegue o access_token
#em https://developers.facebook.com/tools/explorer
url = 'https://graph.facebook.com/search?q='
tail = '&type=post&access_token=<copie aqui o access_token>'
resp = urllib.request.urlopen(url+texto+tail).read()
data = json.loads(resp.decode('utf-8'))
return data['data']
for resp in search('talkabit'):
if 'message' in resp:
print (resp['from']['name'] + ': ' + resp['message'] + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment