I'm building an app using Backbone.js and a private API that serves assets and JSON.
Most content in the app is accessed through the root '/' and the Backbone router serves up views based on the hash (ie /#about or /#view).
The problem is that when a page is shared to Facebook, it scrapes the main page and seems to disregard anything past the hash mark.
Are there any good rules of thumb for url paths or content that is not highly dynamic to make the app more presentable to Facebook, Google, etc?
Google has some good info on making AJAX apps crawlable.
https://developers.google.com/webmasters/ajax-crawling/
You could create a dummy page on your site with a full URL that is only accessible to the bots that Facebook and Google use. I'm not sure what Google's user agent is, but Facebook's is listed here:
https://developers.facebook.com/docs/reference/plugins/like/#scraperinfo
So you could have a blank page on /item/itemid1/ that is only accessible to the bots, point your og:url tags to that blank page and have the correct metadata on it for the Facebook scraper. Whenever a regular user tries to access it, redirect them back to the correct hash-based URL.
Related
I've made a website, which relies on Facebook OAuth in order for the user to participate in a competition.
The canvas URL within Facebook differentiates between https://www.mycompetition.com/ and https://mycompetition.com
Our server is set up to receive both entries, but if I enter the site using www, Facebook complains that the URL doesn't match when authorizing.
Do you know how to make Facebook accept both entries?
Solved, by the way. The webserver now contains two websites. The first contains the website, the second one just redirects to the first one, using JS. Easy :)
Is wall sharing (performed through the FB JS API) in any form related to the Site URL setting for a given application? Users don't actually log in to our website using the tool - they just share the URLs on their walls via an application we've setup.
We are looking for expert confirmation on the subject as we'd like to change the Site URL in support of a new login provider wrapper (Janrain).
No, you can share urls even if the Site Url is not supplied. But the domain should be listed in the "App Domains" box. This shouldn't be a problem since it supports multiple domains. An example would be both myapps.mydomain.com and myapps.myotherdomain.com are listed there. I think this is ok in your case.
I'm planning on launching a website and an accompanying facebook page. Although each of these 'sites' will have their own goal, I'd like to have a 2-way sync set-up for part of the user generated content on my site, such that:
Content published on my site (by editors, or users) that satisfies some criteria are pushed to the wall of the accompanying facebook page
The other way around: content published on the facebook page wall by users, is pushed to my website. (I want to be in complete control of how to format, display, annotate that content, so I'm not looking for some ready-made widgets)
For 2. I'm pretty sure I can poll for a newsfeed or channel of the specific facebook page at regular intervals, but I'm wondering if a tighter integration is possible, i.e: pushing the changed content(delta's, river whatever you want to call it) to a dedicated rest-endpoint from which my website can consume the contents or something.
For 1. I need an automated way to post to the wall of the facebook page I own. Preferrably with the user-credentials (if okayed by the user) if that user was logged-in on my site through Facebook, or otherwise with some fallback credential, e.g: my own facebook credentials.
Just looking for some pointers where to start looking in the vast Developer Facebook resources, or, better yet, some libraries (prefferably Node.js, but others are okay to look at architecture) that take care of some of the plumbing
1) You can post on page with different ways
as a user : You need user access token and he should be a fan of the page or If your fan page allows wall posts from any user in its settings.
as a page : You need page access token
You can get page access token and extend it for long time and store it in DB. You can use it 60 days.
FYI:
Extended access token
Tutorial
2) Using graph API you can pull at regular intervals. There is a real time notification system also but it very limited for pages (its not useful for your case).
FYI: Real Time Updates
I have a standalone PHP web app which consists of several pages in a checkout style process, the user posts a form on each page to the next with the collected data.
I am trying to port this to a Facebook Canvas app.
What is the best practice for posting forms from page to page in a Canvas app? Should I just post as normal with a form target of _self? If I do that though I understand I might not get the signed request on each page.
Correct, when you form post to _self, then you will not get a signed_request. You should hold the user information in some server side storage such as a session object.
Been reading the docs about canvas and secure canvas, mainly due to the requirement that we provide a secure url before october 1. However, I cannot determine with any sense of certainty that we actually need to use a secure canvas.
If we only want to provide the ability for users to "login" and "like", do we even need a canvas? As far as I can tell, a canvas is something that facebook creates an iframe for, which points to a canvas url we provide, which is ultimately displayed on the facebook site.
Any clarification would be appreciated.
Apps accessed via facebook.com (i.e apps.facebook.com/something or via a Page Tab) will need to be accessible over HTTPS - you won't need to make your site to be available over HTTPS for the social plugins or off-Facebook API usage to work
The blog post with the details is https://developers.facebook.com/blog/post/499/
Specifically: All Apps on Facebook (Canvas and Page Tabs) must support HTTPS by October 1.