Created
April 1, 2018 07:28
-
-
Save jennyonjourney/f05a5ce668504ff63f67e8ffae42b58b to your computer and use it in GitHub Desktop.
Facebook API
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
# developers/facebook.com 으로 접속 | |
import urllib.request as ur | |
import json | |
page_name='jtbcnews' | |
base = "https://graph.facebook.com/v2.8" | |
app_id = "200920440387013" | |
app_secret = "daccef14d5cd41c0e95060d65e66c41d" | |
access_token = app_id+"|"+app_secret | |
url = base+'/'+page_name+'/?access+token='+access_token | |
print(url) | |
req = ur.Request(url) | |
response = ur.urlopen(req) | |
if response.getcode()==200: | |
data = json.loads(response.read().decode('utf-8')) | |
print(data) | |
print(data['name'],":",data['id']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment