When sharing an article on facebook in a status, facebook generates a title, abstract and attach an image to the shared article.
For instance, putting www.stackoverflow.com in your status will geenrate
Stack Overflow
https://stackoverflow.com/
This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
(which btw: is not in the source code of stackoverflow.com page)
But when trying something like an article in news website, we get some extracted results from source code of the page (check any article in www.goal.com for example) ..
Any idea about the algorithm facebook uses for that ?
The meta data used by facebook to display links is always extracted from the html source code.
As #amit said, the description is present in the source and the title is taken from the title tag.
You can see that facebook is complaining though if you check that url in the debugger.
If you click the last link on the page (See exactly what our scraper sees for your URL) you can see the response the fb scraper is getting.
This source can sometimes differ from what you get in your browser (though not in this case) since some websites check for the user agent string and if it's the fb scraper (facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)) then a different response is returned.
Related
I write a blog but now nothing about programming.
Until some time ago, whenever I shared a new post on FB it chooses the first image of the post and that was fine (although I'd prefer to control which one to share every time). And it also got the title of the post correctly.
Now it always chooses the header picture of the blog and inserts the blog's title and description instead. Also, if I try to share the blog itself it chooses not the header picture but some old one from one given post...
FB debugger gives me this:
"og:image was not defined, could not be downloaded or was not big enough. Please define a chosen image using the og:image meta tag, and use an image that's at least 200x200px and is accessible from Facebook. Image 'http://1.bp.blogspot.com/-vVHBaAssg-E/VdiSUEICydI/AAAAAAAAApw/Tsmhu4ZefTk/s1600/dpca%2Bblog%2Bcover%2Bv3.png' will be used instead. Consult (...) for more troubleshooting tips.
To find the object, these are the redirects we had to follow"
But the pictures in the post (or the blog's header) are in fact larger than 200x200.
I've added code as suggested in FB and bloggers tutorials but still no juice...
What's wrong?
I'm using AddThis as the sharing "platform".
Example post: http://doportocomamor.blogspot.pt/2016/02/brincar-com-o-fogo.html
thanks a lot in advance
Facebook LIKE/SHARE functions are generally not working on my wordpress blog. I cannot LIKE or SHARE any new posts, but oddly if I have already LIKED a page, the SHARE function works fine.
The problem with SHARE is that the normal sharing window pops up, but there is no metadata populated in it. I've looked at the metadata in my blog posts and as best I can tell it is populated correctly by Wordpress. Additionally, I cannot find any differences in the metadata or code between posts that I have previously LIKED and ones that I have have not.
I've tried running the FB debugger/linter for a number of posts on my site and each one returns the message:
Error Linting URL: An internal error occurred while linting the URL.
I've tried googling this error, but cannot find any useful advice on what might be causing it.
Here is a sample post for people to examine this problem:
http://erb.kingdomnow.org/michael-pollan-talks-about-his-new-book-cooked-video/
Thanks...
You should use Open Graph tags (see "Use proper Open Graph tags and large images to generate great previews" and "Using Self-Hosted Objects") in the header of your webpages to help Facebook determine what metadata needs to be shared.
Since you are using WordPress, you could either edit the template file in your theme that defines page headers (normally header.php) or use Facebook's official plugin.
I run a site that allows registered site members to refer people back to my site using their referral link
(EX: http://www.mygreatsite.com/home?ref=MaxP)
Recently I coded into my site an implementation of the "Direct URL Example" (https://developers.facebook.com/docs/reference/dialogs/feed/) in order to enable my site members to post to their timeline a post which describes my site and includes their own referral link back to my site within the code.
Everything is working fine when a prospective site referral viewing the resulting post clicks upon the post link text (the get sent to a properly formatted referral link as planned - "http://www.mygreatsite.com/home?ref=MaxP"
The problem I'm having is that in the same post if the prospective site referral clicks upon the image then the referral link get's garbled like this "http://www.mygreatsite.com/home?ref=nf" which is a totally invalid referral link that has nothing to do with what link it should be sending them to ("http://www.mygreatsite.com/home?ref=MaxP")
Why is facebook erroneously arbitrarily replacing the proper referrer "MaxP" with "NF" only when clicking upon the image of the post? What does NF mean and why is it there?
Here is the URL that my code is passing to facebook (site url, app id, and name replaced to protect my privacy):
https://www.facebook.com/dialog/feed?app_id=161070640444808&link=http://www.mygreatsite.com/home?ref=MaxP&picture=http://www.mygreatsite.com/images/banners/9.jpg&name=mygreatsite.com%20Ultra-High%20Payout%20site&caption=Paying%20DAILY%20to%20virtual%20points&description=%20%20is%20an%20ultra-high%20paying%20get%20paid%20to%20%28site%29%20site&redirect_uri=http://www.mygreatsite.com/members/refer.php
Thank you.
The problem I'm having is that in the same post if the prospective site referral clicks upon the image then the referral link get's garbled like this "http://www.mygreatsite.com/home?ref=nf" which is a totally invalid referral link that has nothing to do with what link it should be sending them to ("http://www.mygreatsite.com/home?ref=MaxP")
ref=nf is a Facebook parameter for tracking where the link click came from/occurred (in this case nf = news feed).
I think Facebook just overwrites any pre-existing URL parameter of that very name by it’s own – so I’d suggest naming your own parameter something different, that does definitively not get used by Facebook, for example myRef=MaxP.
You will still get the ref param from Facebook, but it should result in an URL like …/home?myRef=MaxP&ref=nf, so that you’d still be able to read your own referral value from it as myRef. (In theory; haven’t tested this myself yet – please let us know the result ;-))
I have read a guide for publish link to my wall or my fan page. Here is the guide: net.tutsplus.com/tutorials/php/wrangling-with-the-facebook-graph-api/
This is my application test:
http://www.onlyimagination.com/mytest/source/
The application works, but i don't want GENERATE the link manually, i want only SHARE.
This is the screenshot of the publish of this app
Instead I would just put the link and my application AUTOMATICALLY extracts all the links like this sharing of information here in this screenshot.
The info presented in the 2nd screenshot is just the info of the picture that facebook has.
In order to tell facebook how to present your links you need to use the Open Graph protocol (you can also use the Open Graph docs).
With this protocol you define properties which facebook knows how to extract, such as title, type, image and more.
This means that the response for every link you want people to share on facebook should contain the og meta tags.
Edit
Sorry, did not think about adding this before:
You can use the Debugger tool to see how facebook "sees" urls.
You see, what happens when a user shares a link is that facebook has a program that send a request for the shared link, it then parses the response and search for specific tags to extract the data which is then presented to the user.
For example, try the Debugger for google.com and see what info was extracted, then try to share it and see that it uses the same info.
Also, at the bottom of the Debugger result, there's a link Scraped URL: See exactly what our scraper sees for your URL if you click that you see the actual response.
Hope this clarifies it.
2nd Edit
I don't know how you publish your posts in your app (next time it could be easier if you just add the code you use), but it doesn't matter how you publish it (js sdk or from the server side) you always have two options:
Post a link that has the og meta tags in it, those will tell facebook how to display the link
Add the link, picture, name, caption and description fields when posting (js sdk for client and graph api for server)
When we first put up a blog post, Facebook often (but not always) gets confused about what the page is. Specifically, if you try to use the Like button on the blog page OR if you try to share via the Share link on your profile, Facebook will see the root blog page rather than the actual post page.
For example, we recently posted:
http://thisorthat.com/blog/2010-song-of-the-year-round-1-results
If the user "likes" it, it returns the title for:
"http://thisorthat.com/blog"
When you run the post URL through the FB Linter, you can see the problem.
"http://developers.facebook.com/tools/linter?url=http://thisorthat.com/blog/2010-song-of-the-year-round-1-results"
In the Debug section it shows an extra og:title, og:url, description and og:image (the last 4 rows of the Debug section). This is the meta data from the root directory. What we cannot figure out is why. Why is Facebook seeing the correct meta data on the page and then also pulling the meta data from the root directory (and using that incorrectly to populate the data for the Like button and the Share URL tool)?
One other oddity. FB "figures it out" after a few days. Of course, by that time relatively few people are viewing the post.
UPDATE -- I want to thank Peter Bailey again for his answer, but we also discovered that there was another issue that we had to resolve before the Like button worked.
The issue was that we were displaying the Facebook the Like button on a post that was not yet published. The problem with this is that FB then can't resolve the URL and "guesses" as to the correct URL. In our case, it always guesses thisorthat.com/blog. Unfortunately, it then caches that guess for a number of days and that cache cannot be cleared by the Linter. So the ultimate solution was to both fix the og:type as Peter suggested, but also to remove the Like button from the blog post preview. It's very important that you don't show FB a page before it's published or if you do, change the URL.
Pretty sure it's your Open Graph type that's the problem.
<meta content="website" property="og:type"/>
Per the documentation
Use article for any URL that
represents transient content - such as
a news article, blog post, photo,
video, etc. Do not use website for
this purpose. website and blog are
designed to represent an entire site,
an og:type tag with types website or
blog should usually only appear on the
root of a domain.