如何设置 Facebook 时间线封面照片自动上传到网站?
我是 Facebook API 和应用程序开发的新手。我正在尝试建立一个 Facebook 时间线封面网站,用户可以在其中自动上传封面并将其发布到以网站/应用程序名称创建的新专辑中。然后他们将被重定向到我网站上的另一个页面,其中包含有关如何在他们的个人资料时间轴上设置封面的说明。大多数个人资料封面网站都使用相同的方法,例如 myfbcovers.com、facebookprofilecovers.com、profilephotocovers.com、facebook.coversdaddy.com、fbcoverlover.com 和 newfbcovers.com 等。我一直在网上搜索 Facebook 开发者页面和一些教程。我检查的一些教程是:
http://thinkdiff.net/ facebook/graph-api-iframe-base-facebook-application-development/
http://daipratt.co.uk/facebook-api-upload-photo/
http://developers.facebook.com/blog/post/498/
还有几个 YouTube 视频。
但我对该应用程序有一些困惑。很抱歉这些问题太基础了,因为我是一个愿意学习的新手。主要问题之一是大多数教程都已经过时,如 facebook 应用程序创建页面等。现在不同了,教程中使用的选项中现在没有回调 url 等或画布等。在教程中,提到要为页面创建网站应用程序或 Facebook 应用程序,我需要一个现在看不到的回调 URL。其次,如果这些教程中提到我的应用程序网站需要 SSL,但上面列出的 Facebook 封面网站似乎都没有 SSL。我的服务器上也没有 SSL。因此,不确定是否需要这样做,以及我的本地服务器上是否需要应用程序。所有应用程序都在做不同的事情,例如我可以通过单击一些用于上传封面按钮的可单击链接来看到这些 URL。以下是一些示例:
http://freetimelinecovers.net/facebook/?cov_img=/images /sports-covers/manchester-united.jpg
有些有直接链接到 Facebook 应用程序页面,例如:
http://apps.facebook.com/profilephotocovers/index.php?id=35 损坏的链接
并且只有一个网站的网址本身似乎有publish_stream等
<一href="https://facebook.com/dialog/oauth?client_id=162046520556852&redirect_uri=http%3A%2F%2Ffacebook.coversdaddy .com%2Fi-m-not-a-monster-1242.html&state=e4abcdc1d9288be8233a7ac4aa243997&scope=user_photos%2Cpublish_stream" rel="nofollow">https://facebook.com/dialog/oauth?client_id=162046520556852&redirect_uri=http%3A%2F%2Ffacebook.coversda ddy.com%2Fi-m-not-a-monster-1242.html&state=e4abcdc1d9288be8233a7ac4aa243997&scope=user_photos%2Cpublish_stream
通过检查 Live HTTP 标头,似乎所有网站都遵循类似的模式,直接在最后一个网站的 URL 中使用。例如,以下是我在检查 Live HTTP header 时看到的其他网站的几个步骤。
<一href="https://facebook.com/dialog/oauth?client_id=237897089598589&redirect_uri=http%3A%2F%2Ffacebookprofilecovers.co m%2Fwp-content%2Fthemes%2Ffbcovers%2Ffb%2Findex.php&state=0ca1581f006bdd80bd5da78e95179f3a&scope=publish_stream" rel="nofollow">https://facebook.com/dialog/oauth?client_id=237897089598589&redirect_uri=http%3A%2F%2Ffacebookprofilecovers .com%2Fwp-content%2Fthemes%2Ffbcovers%2Ffb%2Findex.php&state=0ca1581f006bdd80bd5da78e95179f3a&scope=publish_stream
等等。
我还注意到,几乎所有网站都只对publish_stream进行身份验证,而没有其他任何内容。只有 myfbcovers.com 是一个例外,它也要求提供 user_photos 和电子邮件。其他人并不要求相同,因此也许publish_stream是唯一需要的权限。
那么,创建应用程序是否有任何教程。我是否需要将应用程序托管在我自己的服务器上的网站子目录中,还是直接调用 facebook。我问的原因是因为 Facebook 应用程序如果托管在本地服务器上,则需要强制使用 SSL,而上述网站都没有 SSL/https。如果我不需要在自己的服务器上托管该应用程序,那么我如何将照片上传链接到 Facebook,然后返回到网站以获取其余说明。我在我的网站上使用 Wordpress,就像大多数其他网站一样,所以我想这应该不是问题。任何帮助将不胜感激。我愿意正确学习,如果没有完整的代码,一些关于创建相册然后将照片上传到用户相册等的好教程也可以。任何帮助将不胜感激。
注意:我已经删除了上述许多 URL 中的 HTTP 和 WWW 部分,因为作为新用户我最多只能发布两个链接。如果需要,请在没有的地方添加它们。
I am new to Facebook API and app development. I am trying to build a facebook timeline cover website where users can auto upload and publish the cover to a new album created in the website/app name. Then they would be redirected to another page on my website with instructions on how to setup the cover on their profile timeline. Most profile cover websites are using the same method such as myfbcovers.com, facebookprofilecovers.com, profilephotocovers.com, facebook.coversdaddy.com, fbcoverlover.com and newfbcovers.com to name a few. I have been searching the facebook developer pages and several tutorials over the net. Some tutorials I checked are:
http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
http://daipratt.co.uk/facebook-api-upload-photo/
http://developers.facebook.com/blog/post/498/
And also several youtube videos.
But there are several confusions I have about the app. Sorry for the questions if they are too basic as I am a complete newbie who is willing to learn. One of the main problems is that most of the tutorials are outdated as the facebook app creation page etc. Now is different and there is no callback url etc. or canvas etc. in options now which are used in the tutorials. In the tutorials, it is mentioned that for creating a website app or facebook app for page, I need a callback URL which I cannot see now. Secondly, if it is mentioned in those tutorials that I need SSL in my website for an app but none of the facebook cover websites listed above have SSL it seems. I also do not have SSL on my server. So, not sure if that is needed and if an app is needed at all on my local server. And all the apps are doing things different such as I can see these URLs on clicking on some of the clickable links for uploading the cover button. Here are a few examples:
http://freetimelinecovers.net/facebook/?cov_img=/images/sports-covers/manchester-united.jpg
Some have direct link to the facebook app page such as:
http://apps.facebook.com/profilephotocovers/index.php?id=35 broken link
And only one website seems to have the publish_stream etc. in the url itself
On checking through Live HTTP header, it seems all websites are following a similar pattern which is directly used in the URL in the last website. For example, here are a few steps of the other websites I saw while checking with Live HTTP header.
And so on.
I could also notice that almost all websites were taking auth for only publish_stream and nothing else. Only myfbcovers.com is an exception which also asks for user_photos and email. Rest are not asking for the same and so perhaps publish_stream is the only permission needed.
So, to create the app is there any tutorial. And do I need to host the app on my own server in a sub directory of the website or does it make direct call to facebook. The reason I am asking is because it seems Facebook apps if hosted on local server needs SSL mandatory whereas none of the above websites have SSL/https. And if I do not need to host the app on my own server then how can I make the photo upload link to facebook and then return back to the website for the rest of the instructions. I am using Wordpress on my website like most of the other sites are doing and so, that should not be a problem I suppose. Any help would be highly appreciated. I am willing to learn properly and some good tutorials for creating the photo album and then uploading the photo to the user's album etc. would be fine too if not with the full code. Any help would be highly appreciated.
NOTE: I have removed the HTTP and WWW part in many of the above URLs as I can only post a maximum of two links being a new user. Please add them if needed in those where they are not present.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我没有安装上面所有的应用程序来看看它们究竟做了什么。我认为你的问题很长......但很简单。这就是我对你问题的理解:
您想创建一个封面照片生成器,允许用户通过上传文件来自定义他们的封面照片,也许可以对它们进行一些编辑。也可能使用很酷的想法模板,最终能够将他们很酷的新封面照片直接更新到他们的个人资料中。
这并不是很复杂,尽管到目前为止还没有真正的文档(来自 facebook) )关于如何动态更新封面照片。不过,有一些方法可以创建相册并将照片上传到那里。
如果您计划让您的应用程序在 facebook 中运行 - 这意味着使用
apps.facebook.com/your_app_name
,并且具有画布或选项卡 URL,则您必须购买 SSL 证书。最后,为了尽可能接近您想要的功能,您可能必须做出一些牺牲(因为使用 Graph API 尚还无法更改封面照片)。
要找到封面相册,您必须手动扫描所有用户相册名称 - 为此,您需要
user_photos
权限。创建所需的照片后,您可以让用户将其上传(为此需要
publish_stream
权限)到其他相册,然后使用屏幕截图向用户提供一些详细说明并指导他们到底如何更改他们的封面照片。我建议您通读身份验证文档来决定您需要的权限(例如用于用户照片的
user_photos
和publish_stream
> 用于上传新图片或创建相册。)此外,官方 Facebook 文档页面 及其 开发者博客 - 在访问其他已经编写了自己的教程的网站之前先查看它们。 Facebook 确实更新了他们的 API - 但他们(最近)也非常擅长更新他们的文档以反映 API 的更改...
As serious developers using a 3rd party API (
Graph API ), it is solely our responsibility to keep up to date with changes and to write code and applications that comply with their platform policies.
Ok, I did not install all the applications above to see exactly what they did. I think your question is long... but pretty straight forward. This is what I understand your question to be :
You would like to create a cover photo generator that will allow users to customize their cover photo by uploading files, maybe doing some editing to them. Also maybe using templates of cool ideas and in the end being able to update their cool new cover photo directly into their profile.
This is not very complicated to do although to this date there is no real documentation (by facebook) about how to dynamically update the cover photo. However there are ways of creating photo albums and uploading photos to there.
If you are planning to make your application run with in facebook - that means use the
apps.facebook.com/your_app_name
, and have canvas or tab URLS, then you will have to purchase an SSL certificate.Finnaly, in order to get as close to the functionality your want, you might have to make some sacrifices (becuase changing the cover photo is not possible yet with the Graph API).
To locate the cover photo album you'll have to manually scan through all the users albums names - and for that you'll need the
user_photos
permission.Once you have created the photo you want, you could possibly let the user upload it (
publish_stream
permission needed for this) to a different album, and then give the user some detailed instructions using screen shots and direct them exactly how to change their cover photo.I recommend you read through the Authentication documentation decide what permissions you need (such as
user_photos
for the users photos andpublish_stream
for uploading a new picture or creating an album.)In addition, there are many many tutorials on the Official Facebook Documentation Pages and their Developers Blog- check them out before going onto other sites that have written their own tutorials. Facebook does update their API quite a bit - but they also (recently) have been pretty good on updating their documentation to mirror the changes to the API...
As serious developers using a 3rd party API (
Graph API ), it is solely our responsibility to keep up to date with changes and to write code and applications that comply with their platform policies.