Rails multiple facebook like buttons. Redirected link meta tags problem - ruby-on-rails

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.

Related

How to add Facebook meta tags to cloud hosted images?

I'm trying to share some images via the Facebook sharer url "https://www.facebook.com/sharer/sharer.php".
The images are stored in the cloud in azure blobs, so I have a url that looks like "https://myapp.blob.core.windows.net/xxxx.gif"
In order for the Facebook sharer to correctly display the image it's looking for some meta tags, like "<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>"
What would be the best way to add those tags to cloud hosted images?
Options 1
Build a redirect url that takes the id of image adds the tags then redirects to the cloud url?
Any other ideas? Would option 1 work?
You're confusing two different things. The meta tags are for web pages, where if just the link to the page is shared, Facebook can then inspect the page and create a rich representation of it in the post by relying on those tags.
If you need to share a link that happens to be to an image, then you can't use meta tags. However, you might be able to use share intents to add some context to the link. For example, if you wanted to provide a link on a web page that will allow people to share the link to the image, you could do something like:
https://www.facebook.com/dialog/feed?app_id=[appId]&link=[url]&picture=[imageUrl]&name=[imageName]&caption=[imageCaption]&description=[imageDescription]&redirect_uri=[redirectUri]
That would take the user to a dialog that would allow them to make a post to their Facebook account, with all the provided information prepopulated. The redirect_uri tells Facebook where to send them back on your site when done posting.

Is is possible to share elements or parts of a page on social media sites?

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 :)

Configuring Facebook's Page Like Button

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/

How to attach a site thumbnail from user submitted links in a facebook application

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.

Linking to a specific section of a page from Google custom search engine result

I would like to know if there is a way when using Google custom search engine to have Google CSE link to a page with a URL like this
http://www.mysite.com/mysection/mysectionarticles.html#myarticle234
or something close to that.
Let’s say Google would find the searched words in a certain part of the page it could be in a or after an anchor or something like that and would supply in the search result a way to link to this specific section of the page.
So if you have big pages the user wouldn't have to scroll through the page to find the relevant part he saw in the CSE snippet.
It could also be used if you have a dynamic page that change state using JavaScript. Part of the page is hidden to the user until he does an action in the pages, but this hidden content was indexed by Google because it’s part of the page. So when the user clicks on the link in the search result he ends up on a page and can’t find the relevant part because it’s hidden.
Take a look at Google's support for structured/rich data and ajax urls for crawling (aka hash-bangs). One or both of them ought give you access to the pages with the right things displayed.

Resources