I'd like to have a facebook like button, and I would like it to act like this:
When a user clicks on the button in the user's news feeds the following is shown:
- the name of my site
- link to my web site
- my web site logo
- short description
I am using ruby on rails 3.
Would you be so kind and help me configure this?
Thanks, D.
There are two steps on how to achieve this. First step is to use the appropriate OpenGraph Tags on your website. These are just additional tags in your HTML head. You can find examples on the Open Graph Webspage.
Second step is to embed the like button. You can configure the code on the Facebook Developer page. When a user clicks on the button, the OpenGraph tags are automatically parsed and the result is shown in the user's stream.
Configure your requirement in below page
You can get the required script for facebook like button, by giving inputs to the widget in the page
http://developers.facebook.com/docs/reference/plugins/like/
Related
I'm hoping this is a pretty simple question to answer. I have a page with 6 recipes on it. I'm being asked to include share buttons for each recipe and they want the shares on FB or Twitter to be formatted to use a specific image and text for each recipe. This is something we would normally handle via Open Graph metatags and the like, but that only works at the page-level.
You must use a separate URL/page for each Like/Share. But you can redirect to the main page, or just use a GET parameter. For example, each Like/Share Button can use the following URL: http://www.yourdomain.com/yourrecipepage.php?recipeid=x
The "x" being dynamic, of course. Now you can check the recipeid parameter and use different OG tags. the rest of the page will be the same. I hope you understand what i mean :)
Is it possible to have a custom share image for Facebook, Google+ and Twitter?
I've already set up the open graph tags in the head of the document.
Thanks
UPDATE:
For Facebook:
<a href="http://www.facebook.com/share.php?u=url" target="_blank" ><img src="fb-img"/></a>
For Twitter:
<img src="twitter-img" />
Still looking for google+
By the way, any difference with sharer.php v/s share.php for Facebook?
I found the best solution to implement custom share button with Facebutton:
Go to facebook developers page and there you will have to read the following article which will explain you how to use meta tags (HTML) on the head of your page:
https://developers.facebook.com/docs/sharing/webmasters
Basically you need to add a Share Button on your page, right?. So, what you need to do is first of all, add the meta tags that page ask you for on the head of your page. Then everything is so easy. After facebook provides you with the code for the share button, now when you click on it, it will show you the image you specified on your meta tags. Take a look at that page and you'll see how easy is to implement it.
Twitter still i haven't implement it yet neither for google :(
I am trying to implement a feature to your web application, in which if a user saves a website's url, it is stored and displayed in the library. Now when a web url is saved in facebook, the first few lines of the webpage is also displayed. I also want to implement a similar feature.
I am using Ruby on Rails. I tried using the .load() method of jquery, but using that I am only able to retrieve description of pages which are in the application. I want to save a url in my app, eg, "api.jquery.com/load/";, and while displaying the list of urls, I want to display a description of the page, like its shown in facebook when you enter a url in the status update
Any suggestions on how to do it?
The Facebook application I had in mind has users submit links from sites. I would like there to be a thumbnail of the site, similar to what happens when you post/message someone a link and a thumbnail automatically shows up. Any thoughts on how to go about doing this?
The sites you link to need to have Open Graph tags (https://developers.facebook.com/docs/opengraph/) on their pages to set the default image, description and title for this to happen. If those meta tags are not set, the first image on the page will be the default along with other generic information Facebook is able to scrape from the page.
If you want to test out a few pages and see what information they have set, use Facebook's URL lint tool (https://developers.facebook.com/tools/debug). Simply copy and paste any URL in there.
I am having that problem that I got some items on a list that needs a like button.
That means I got multiple items on a page. I want to show an unique image and text when a user press like. The problem is that facebook meta tags goes in the header and it is only for the page. That means that the facebook like images are the same for all items. I have read this guide http://hillarsaare.com/multiple-facebook-like-buttons-on-one-page/ how to create multiple facebook likes with unique images and links. But my link that the user likes is a link that is been redirected in my controller to an external URL without any view.
Where should I place the meta tags? Should I create an view for my link ? How should I make an delay on the link that is been redirected?
I made a show file for my link. And but the facebook meta tags in the header, and some javascript to make the redirecet to my external link. In that way I can have multiple like buttons on a page with unique like information and images.