问:如何允许我的用户在我的网站上显示他们的 Instagram 提要?
我有一个 Rails 5 应用程序,它一直依赖于来自 Instagram 的非官方且未记录的 API(基本上在 URL 后附加 /?__1)。我想允许我的所有用户输入他们的个人资料 URL,然后在他们的公开个人资料上显示他们的 Instagram 提要。
我看过,https://www.instagram.com/developer/embedding/但它没有说明嵌入实际提要。
如果我让所有用户使用 oauth 与 Instagram 集成,然后使用特定令牌查询他们的提要怎么办?
很想听听别人怎么做。谢谢。
对于 Stripe 的新结帐,需要在创建会话后重定向到外部 URL。
def create_checkout_session
Stripe.api_key = "sk_test_"
session = Stripe::Checkout::Session.create({
line_items: [{
price_data: {
currency: 'usd',
product_data: {
name: 'KYC services',
},
unit_amount: 1000,
},
quantity: 1,
}],
mode: 'payment',
# These placeholder URLs will be replaced in a following step.
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel'
})
redirect_to session.url, status: 303, allow_other_host: true
Run Code Online (Sandbox Code Playgroud)
我的redirect_to 没有带我去任何地方,并且终端中没有错误。如果我不包含 ,allow_other_host: true我会收到一条错误消息Unsafe redirect to "https://checkout.stripe.com。
如何在 Rails 7 中强制重定向到外部 URL?为了这个演示应用程序,我不介意漏洞。