Facebook Like button og:image needs to be scraped to be displayed - facebook-like

I've got a Drupal website with articles on them which have Facebook like buttons.
Now I've got all the OpenGraph metatags added on the pages and it's all working perfectly except for one thing.
Site visitors can share a page URL or like a page URL.
When a new article is added and the first person who presses the like button will not see the image added in the og:image tag.
If another person afterwards presses the like button, the og:image however is visible so it seems to me Facebook needs to scrape the page first before the og:image is added in the 'Facebook Like window'.
The Facebook share doesn't seem to suffer from this problem and does it right from the first time.
Now whenever somebody adds a new article, I'd need the URL of the article to be scraped automatically by Facebook using some PHP code or some other fix...
Anyone who knows if autoscraping a URL is possible or does anyone have an idea for a workaround?

You can use the graph API with scrape=true to force Facebook to scrape you right when you create your contents
https://developers.facebook.com/docs/beta/opengraph/objects/

Related

Is it necessary to create pages with the recent changes to the Facebook like button?

I was reading over the changes to the Facebook Like button that are scheduled to take place in November 2012, and I'm a bit confused (and hoping someone has an answer).
I understand that the REST endpoints are being removed in favour of regular pages, but here's where I'm confused.
Previously, if I did the following...
Create a page
Add the correct OpenGraph metatags to the page
'Like' the page
... Then an OpenGraph object would be created automatically (and could be verified by visiting http://graph.facebook.com/?id=my_url). If I published to that OpenGraph object, people would receive updates.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created? Or it is created, but I still need to create a Facebook page to administer and send messages?
Any help would be appreciated.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created?
That phrasing is a little besides the point.
You create the Open Graph object, by setting up a page with appropriate OG meta tags.
And Facebook will count likes for this URL, like for every other URL.
Or it is created, but I still need to create a Facebook page to administer and send messages?
No admin pages will be created automatically any more; although you can convert existing ones to normal public Facebook pages. But then you have to point the like button to the URL of that new Facebook page instead of your OG URL to be able to publish updates to your fans. (So this will behave basically like a normal Facebook page that was set up to be one in the first place; only this step allows you to “migrate” your existing likers for your OG URL to that page, so you don’t need to have a “fresh start” with your Facebook page.)
The document further describes, what to do if you still need the ability to publish updates to the users liking your OG URL – by providing fb:app_id and fb:admins meta tags:
“This will ensure that the Like Button admin link still appears on the given Open Graph page. The admin page for a given Like Button is also accessible to administrators from https://www.facebook.com/bookmarks/pages”
But publishing updates this way will only work until the Like Button admin page is fully deprecated. From then on, you will have to use a Facebook page, if you want to be able to publish updates to the users who liked your page.

The admin option doesn't show up next to my like button

I have a problem. I created an app in FB and then with that app I created a like button. FB says that I should see an admin link next to my like button on my website when I am logged in.
I have fb:app_id and fb:admins set up in meta, still I don'see the link. I would need it for two reason.
One is to acces the admin of the page so I can send messages for people who liked my site, also I want to set up a fanpage and once I could access the admin of the website likes according to the facebook documentation I could turn it into a fan page (FB page) this way not loosing the likes.
Thanks in advance
That functionality is deprecated, there's a migration guide on Facebook's developer site explaining how to move your OG pages to regular pages if you want to maintain part of that functionality

Facebook likes (with comments) not working well on a password/login protected website

I am working with our web developer to integrate Facebook Likes (with comments) onto our website. However, he is having problems because FB doesn't work very well with sites where a log in is required. Currently when you click on the 'like' button the 'like' turns into 'confirm'. You then have to click on 'confirm' and another box appears showing how the like will appear on your FB page saying 'Click Like to post this to your profile' with the option of 'like' or cancel. If you click on 'like' then it allows the comment box to pop up then you can add a comment and post to FB.
There are currently too many clicks for this to work. Does anyone have any advice? Would it be better to just use straight likes with the number perhaps or is this a common problem with website that require a login. We just want users to be able to click once, add their comment and post it to FB.
Any help would be really apprecaited. If it is technical that is fine as I will pass replies onto my developer.
Many thanks
This will generally happen for URLs and sites that are new to the Facebook scraper. It is a security measure to prevent like-jacking that some sites have done in the past. You should ensure that you test your site fully with the Debug tool and after some confirmed 'likes', that step will be automatically removed and future users will just have to click like once.
Where you are gating content behind a login, I would additionally recommend that you show different HTML (including OG tags) for anything detected with the Facebook scraper User Agent (see When does Facebook scrape my page? on the Like Button FAQ) so that, for example, the OG tags for a product detail page are picked up correctly even though the scraper is technically not logged in.

How does Facebook scrape my website and how can I manually change this information?

I am using the iFrame version of the Facebook like button and was wondering how Facebook scrapes my website. They pulled information in the middle of the page, which was the first paragraph tag, instead of taking from the divs earlier. I was wondering if this is normal and how often Facebook updates their page.
Secondly, I am having problems editing this information in the page settings on the Facebook page that was generated. It would be nice if I could manually override whatever Facebook scrapes from my website.
Thanks,
http://ogp.me/ — more specifically, using an Open Graph description.

Facebook Comment page through API

I've searched for a while but I've only found the Facebook UI, that has some basic dialogs. Maybe some of you know some iOS apps that can open the comments page in a new "page" (e.g. Flipboard). Is there a way to show the comment page directly from Facebook or I have to simulate it through the API?
UPDATE: Not a page comment box. I want to show the comments of a post.
It is possible to create a facebook app showing your comment box. The same comment box can be showed in different pages/ urls using the "data-href" url.
<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470"></div>
You could eventually add an static url in a database or something like that to wich you can always refer.
I dont exactly know what you want but i hope this helps