Why is Facebook's sharer.php properly displaying some of my thumbnails, but not others? - facebook

OK, this is my first question on SO, so be gentle. Doing my best to be thorough. :)
We want users to be able to share URLs specific to ordering photos of their children on our site. We currently have no interest in implementing Open Graph on our site. We're not trying to track that data at this time, and it's more work than I have time for anyway. So I opted for the quickest route: the sharer.php link.
I realize that FB's sharer.php is deprecated in favor of 'og:' tags, but see no indication at https://developers.facebook.com/docs/reference/plugins/share-links/ - which was updated three weeks ago, so it obviously should still work.
I followed the instructions in these blog posts to customize the links:
http://ar.zu.my/how-to-really-customize-the-deprecated-facebook-sharer-dot-php/
http://www.therykers.net/?p=37
However, we only get thumbnails to properly display in the FB Share dialog when using our site's demo subdomain, even though the source code for our sharer.php link is identical in all instances (aside from the image/name of the child, the site's subdomain, and the photography studio name).
This source code (demo site) properly displays the image:
<a href="https://www.facebook.com/sharer.php?
s=100
&p[url]=https://demo.mysmilecentral.com/public/show?link_code=funankizwd
&p[images][0]=http://assests0_bop_heroku_com.s3.amazonaws.com/images/sp00/sp00-001-1/0106_022_0028.jpg
&p[title]=Order%20Pictures%20of%20CASEY%20at%20Sample Studio's%20MySmileCentral!
&p[summary]=View%20images%20and/or%20order%20pictures%20of%20CASEY." target="_blank">
<img src="https://assests0_bop_heroku_com.s3.amazonaws.com/images/fb-share-btn2.png" style="margin-top: -35px; margin-right: 126px; float: right" />
</a>
But this ('live' site) doesn't:
<a href="https://www.facebook.com/sharer.php?
s=100
&p[url]=https://rowlandphoto.mysmilecentral.com/public/show?link_code=2cols21uogpx
&p[images][0]=http://assests0_bop_heroku_com.s3.amazonaws.com/images/bj20/bj20-bb2013-1/1448_img_0128.jpg
&p[title]=Order%20Pictures%20of%20Gabrielle%20at%20Rowland Studio's%20MySmileCentral!
&p[summary]=View%20images%20and/or%20order%20pictures%20of%20Gabrielle." target="_blank">
<img src="https://assests0_bop_heroku_com.s3.amazonaws.com/images/fb-share-btn2.png" style="margin-top: -35px; margin-right: 126px; float: right" />
</a>
Both images meet the dimension requirements of FB Share, and are publicly viewable.
I've spent several hours trying to find an answer (Googling, searching here), and haven't come up with a logical reason for this.

If you open up your web inspector you would realize that https://www.facebook.com/sharer.php deprecated redirects to https://www.facebook.com/sharer/sharer.php, which only has one supported parameter u for the url being shared which depends on Open Graph meta data (which you have opted not to use).
The p array (p[url], etc) is not supported in the new Facebook Share dialog. By using deprecated features, you should expect unstable behaviour or no results at all. There isn't anything much more to say about that.

Related

Blogger (Blogspot) share buttons to count individual post pages on Homepage

I have blog on the blogger (blogspot) platform. When looking at the homepage, the number next to the share buttons for each individual post is only showing how many times the homepage has been shared through each social button.
Is there are way to display the accurate number of how many each individual post has been shared and not just the homepage?
For example, http://mashable.com/ displays accurate social media numbers for individual posts on the homepage. Yet, http://dmw-test-blog.blogspot.com/ is displaying only the number of times the homepage has been shared, even though the buttons are displayed under each post title.
I been searching for hours for a solution. Some suggest to not place the script under the < /head > tag, others suggested using the individual scripts from each social share site instead of the 3rd party ShareThis script, but neither suggestion worked.
Is there a solution or is the Blogger platform the problem?
I found a solution.
By using the 3rd party share buttons from ShareThis, they have a tweak where you can add:
"expr:st_title='data:post.title' expr:st_url='data:post.url'" to each button, forcing the share buttons to display the number of the post title url instead of the browser url.
For example, using the share buttons above, the new code would look like this:
<span class='st_twitter_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
<span class='st_facebook_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
<span class='st_googleplus_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
<span class='st_linkedin_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>

Facebook “Like Box” and JQuery

I'm attempting to add a FB "Like Box" to a website I'm developing. Not too familiar with Facebook apps, but so far I've gone the non-IFRAME route, using the FB SDK script include.
I'm fairly certain I've got almost everything setup correctly. In fact, I see the widget appear when I visit the page UNCACHED (i.e. in FF, I hit CTRL+SHIFT+R to reload all content to avoid loading from cache). Once I revisit the site, or move around within the site by clicking links, the content does not reappear.
I'm wondering if it's an issue with a) the channel.php file, or b) the apps interaction with my use of JQuery. The channel.php file is verbain what is provided by Facebook (using PHP's caching mechanism).
Here's the site currently: http://www.morningfatty.com/demo - It might be easier to list this rather than post several code snippets.
I went to your website and didn't see the like box. I checked the HTML code and it all appeared fine. The div looked like <div data-header="false" data-stream="false" data-border-color="#40ADAD" data-show-faces="true" data-colorscheme="light" data-width="192" data-href="http://www.facebook.com/morningfatty" class="fb-like-box"></div>
I went to https://developers.facebook.com/docs/reference/plugins/like-box/ and tried your link http://www.facebook.com/morningfatty and lo-and-behold the like box didn't display there.
I tried going directly to http://www.facebook.com/morningfatty and it redirected me to http://www.facebook.com/MorningFatty. I noticed the change of case in the name. So I went back and tried http://www.facebook.com/MorningFatty in the like-box and it worked!!.
I believe that you page will work once you update the casing on the url. :)

Facebook "like" button on comments

Is it possible to implement the Facebook like and share functionality for "liking" the comments of other users on a website? Does every comment has to have a permalink?
I have asked the question on Facebook developers forum, and they have come back to me with this response. Basically, the functionality that is required is not available.
http://forum.developers.facebook.net/viewtopic.php?pid=316205#p316205
Intro:
You will need individual like buttons for every comment, and as #Fnatte says you can then reference them to the comment by giving it an ID like #com1,#com2etc...
The best way to achieve this is through a for loop (I imagine you are pulling from a DB) that will iterate through and add the relevant code for the like button and implement the URL based on the comment it is pulling,
The Code:
You have 2 options, <iframe>:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=button_count&show_faces=false&width=90&action=like&font=segoe+ui&colorscheme=dark&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
This is VERY slow, especially if you have a lot of comments loading at the same time, it does mean you don't need to import their JS library though,
Then there is the FB JS SDK:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://example.com" layout="button_count" show_faces="false" width="90" font="segoe ui" colorscheme="dark"></fb:like>
This I would argue is a more eficcient way of doing things, but it does require a bit more time and effort - but will be well worth it.
The script of course can be imported only once in the head and then used multiple times throughout the page (perfect for what you need).
The URL to like is based on both the URL in the address bar and the ID that you have assigned to the code (e.g. #comment1) so the URL you are liking looks like this: http://mypage.com/page#comment1
Further Reading:
http://developers.facebook.com/docs/reference/plugins/like/
http://developers.facebook.com/docs/reference/javascript/
http://developers.facebook.com/docs/plugins/
Good luck and I hope this helps!
DEMO & SOURCE http://so.devilmaycode.it/facebook-like-button-on-comments/
updated, hope this help
I have never done it myself but you should probably check out http://developers.facebook.com/docs/guides/web#plugins.
It looks like you would need a unique link for each comment.
You could try including a fragment identifier in every URL like:
http://domain.com/article1#comment1
http://domain.com/article1#comment2
Facebook has rolled out a new version of the comments plugin which supports advanced functionality such as "liking" and replying to other comments. In addition, replies to a comment made on Facebook.com are now pushed back to the comments plugin (hosted on another site.)
How to enable:
Add the migrated attribute:
<fb:comments xid="YOUR_XID" migrated="1"></fb:comments>
OR use the href attribute instead of xid for future comments boxes
<fb:comments href="YOUR_CANONICAL_URL"></fb:comments>
References:
New <fb:comments>
Legacy <fb:comments>

Is it possible to put an iframe inside a Facebook page tab?

According to the Facebook developer roadmap, it will soon be possible to put iframes inside page tabs but it's not yet available. I came across this Store Locator on Coach page which uses an iframe to display a Google map inside a tab :
http://www.facebook.com/Coach?v=app_168904438199&ref=ts
Looking at the source code, I see the map really is inside an iframe. How is this possible?
in STATIC FBML pages you CAN'T USE IFRAMES - no matter what FBML code you put in there, facebook have specifically made the code not work in in business page/tab static fbml pages - my guess is so they can prevent people setting up Amazon stores or other content that uses IFrame (spammers and spyware often use iframes) - the updates are in their 2010 wiki - so it's probabley also a security thing.
I frames can still be used on developers canvas pages apparently but the customer has to click on an image for it to activate rather than the iframe automatically loading - again this is probably a security issue to prevent driveby downloads - where zwinky and similar toolbars are forced onto people computers in the background via iframes without their knowledge.
However some say it does work although you need a user to click on it before it works. if you can live with that then go for it.
<a onClick="outside_location.setInnerFBML(location_two);" style="cursor: pointer;"><center>→our website</center></a><div id="outside_location"> <fb:iframe width="730" height="400" frameborder="0" src="http://www.fborder.com/" /> </div>
<fb:js-string var="location_two"> <fb:iframe width="730" height="600" frameborder='0' src='http://www.fborder.com/' /> </fb:js-string> <script type="text/javascript" charset="utf-8"> var outside_location = document.getElementById('outside_location'); </script>
check out this post. people have got it to work. and some say it wont work for the obvious reasons. such as security and so on. but give it a go regardless.
http://www.facebook.com/topic.php?uid=4949752878&topic=7081
PK

Facebook IFrame on page canvas?

Hey guys, I have developed a small site that i would like to embed into a tab on a facebook page.
Previously I used this code to load in an iframe, it worked great:
<a onClick="outside_location.setInnerFBML(link_1);" style="cursor: pointer;">Link 1</a> | <a class="red" onClick="outside_location.setInnerFBML(link_2);" style="cursor: pointer;">Link 2</a>
<div id="outside_location"></div>
<fb:js-string var="link_1"><fb:iframe width="760" height="1280" frameborder='0' src='http://www.WebWhispers.in' /></fb:js-string>
<fb:js-string var="link_2"><fb:iframe width="760" height="1280" frameborder='0' src='http://google.com/' /></fb:js-string>
<script type="text/javascript" charset="utf-8">
var outside_location = d
document.getElementById('outside_location');
</script>
However, it has stopped working. I dont think facebook allows iframe inside of pages, only applications.
How can I load this page in without learning FBML? The site uses Jquery so I cant use FBML anyway.
I know applications can use iFrames, can I make it an application and then embed the application into a page tab somehow?
No. Tab pages can not contain iFrames. They must be written using FBML and FBJS.
One reason for this is that Facebook does not want to enable Tab pages to detect who looks at them. All requests (including images) on tab pages are proxied through Facebook for this reason. If iframes were allowed then the application would be able to detect who looked at it, which would present a privacy issue for Facebook users.
This is either a policy change by Facebook or, more likely, a bug. I say it's unlikely to be a policy change as it throws a script error, whereas a policy change would more likely strip the code out before it's rendered.
There's a bug report you can add votes to and follow here.