我正在尝试使用对话框/OAuth 从 Facebook 获取代码参数,以便获取令牌当我尝试使用生成的 URL 登录时,我得到一个空白页面。
我正在使用此代码生成网址
sprintf('https://www.facebook.com/v15.0/dialog/oauth?%s', http_build_query(array(
'client_id' => self::FACEBOOK_APP_ID,
'state' => 'op=add-page',
'scope' => 'pages_show_list,pages_manage_metadata,pages_read_engagement',
'auth_type' => 'rerequest',
'redirect_uri' => url(self::FACEBOOK_APP_REDIRECT_URI),
)));
Run Code Online (Sandbox Code Playgroud)
网址示例
https://www.facebook.com/v15.0/dialog/oauth?client_id=369956434515590&state=op%3Dadd-page&scope=pages_show_list&response_type=code&auth_type=rerequest&redirect_uri=https%3A%2F%2Ftest.com%2Fapi%2Ffacebook%2Fauth
Run Code Online (Sandbox Code Playgroud)
如何使对话框出现以供批准,以便我可以获得代码参数
这是我的代码,用于出席没有参加 google meet 会议的朋友。
我们使用组织电子邮件,所以每个人都有他们的名字作为他们的卷号。
电子表格中记录了使用会议出勤分机号码(谁在场)。
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ["https://spreadsheets.google.com/feeds",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name('Client_secret.json', scope)
client = gspread.authorize(creds)
url = "Url of my SpreadSheet"
sheet = client.open_by_url(url).sheet1
# 66
try:
cell = sheet.find('566')
pass
except gspread.exceptions.CellNotFound:
print('566 Absent')
# 67
try:
cell = sheet.find('567')
pass
except gspread.exceptions.CellNotFound:
print("567 Absent")
# 68, etc...
# ----------------------------------------------------
# Code to delete the spreadsheet once the work is done.
# ----------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
我有责任将缺席者名册编号提供给经理。
我正在尝试保存我的存储空间我不能一直手动删除电子表格,这就是为什么我需要一个代码来删除完整的电子表格使用 …