How does Giphy share gifs to facebook? (2015, NOT FLASH ANYMORE) - facebook

If I paste the following URL into Facebook I can share an animated gif. It's not a movie and not flash, Facebook now supports gifs without those workarounds. I can click it to pause and it shows "GIF" in a circle while paused.
http://giphy.com/gifs/hot-funny-cartoon-fBEDuhnVCiP16
No matter what I replicate from that page's meta tags I cannot get Facebook to share an animated gif form my own page. I've even gone so far as to copy the entire code of that page and serve it myself (Changing <link rel="canonical" and <meta property="og:url" to match my url).
Open Graph Object Debugger gives identical results for both the real Giphy page and my replica. Interestingly, the preview in Object Debugger is the old style Flash movie for both pages. However, when I paste the Giphy url into my Facebook it shows the gif - my relica shows the Flash.
Do Giphy get some special treatment from Facebook? Do I need to do something different?

I was able to create an .html file which, when the link is pasted as a status, displays as an animating (and looping) GIF in the Facebook feed. In my html page, I use the following meta tags in the header:
<meta property="og:site_name" content="Site Name">
<meta property="og:url" content="url to GIF on web">
<meta property="og:title" content="Title of GIF page">
<meta property="og:description" content="Some description">
<meta property="og:type" content="video.other">
<meta property="og:image" content="Same as og:url above">
<meta property="og:image:width" content="800">
<meta property="og:image:height" content="400">
The thing that gave me trouble when I was working on this was the og:url property. It should point directly to the GIF, not the .html file that these meta tags are a part of. Also, og:image should be the same as og:url.
I didn't test if the width and height properties are required.

Product Manager for the Giphy API team here. No special treatment; I wish--filing bugs with Facebook takes forever.
The Flash tag is legacy and we should clean it up. FB now does support GIFs and the answer by vegashacker is essentially correct.

An important point which answers have missed, how to make GIF image (if clicked) redirects to the article which belongs to instead of the GIF link itself?
The important parts are:
<meta property="og:image" content="url/to/image.gif">
<meta property="og:url" content="url/to/image.gif">
<meta property="og:url" content="url/to/article">
Add two og:url tags. First one should be the same as og:image pointing to the GIF image URL. Second one should be the URL to the article.

Actually, I looked at their source code, and I am 99% sure that they are actually showing a video. For this gif, there are a number of open graph meta tags associated with the page:
<meta property="og:type" content="video">
<meta property="og:image" content="http://media.giphy.com/media/H2ANZTOXVepbO/giphy-facebook_s.jpg">
<meta property="og:image:width" content="480">
<meta property="og:image:height" content="270">
<meta property="og:video" content="http://giphygifs.s3.amazonaws.com/swiphy20141103.swf?api_hostname=&gif_url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FH2ANZTOXVepbO%2Fgiphy.gif&giphy_height=297&video_url=http%3A%2F%2Fmedia.giphy.com%2Fmedia%2FH2ANZTOXVepbO%2Fgiphy.mp4&giphyWidth=400&path=%2Fgifs%2Fstar-wars-80s-the-muppet-show-H2ANZTOXVepbO&destination_url=http%3A%2F%2Fgiphy.com%2Fgifs%2FH2ANZTOXVepbO&giphyHeight=297&gif_id=H2ANZTOXVepbO&mode=embed&giphy_width=400">
<meta property="og:video:secure_url" content="https://giphygifs.s3.amazonaws.com/swiphy20141103.swf?api_hostname=&gif_url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FH2ANZTOXVepbO%2Fgiphy.gif&giphy_height=297&video_url=http%3A%2F%2Fmedia.giphy.com%2Fmedia%2FH2ANZTOXVepbO%2Fgiphy.mp4&giphyWidth=400&path=%2Fgifs%2Fstar-wars-80s-the-muppet-show-H2ANZTOXVepbO&destination_url=http%3A%2F%2Fgiphy.com%2Fgifs%2FH2ANZTOXVepbO&giphyHeight=297&gif_id=H2ANZTOXVepbO&mode=embed&giphy_width=400">
<meta property="og:video:type" content="application/x-shockwave-flash">
<meta property="og:video:width" content="470">
<meta property="og:video:height" content="297">
and most of them are video tags. These tags are associated with the page and not a gif. If you share the straight gif image, then it will not animate.
To confirm this, if you plug the page into the Facebook URL debugger, then this can be confirmed. There is no mystery, this is shared as a flash video.

I have been working on this for a while with Facebook debugger and found how to post swf but just today I also successfully posted my animated gif.
I simply pasted my link https://www.example.com/my.gif into Facebook debugger and it said could not find URL but displayed fine giving app id number and then I went ahead and posted in my timeline for all to see :) So no html or tags to achieve that but simply a secure link to my gif file on my server.
Never did I work out how to achieve it via html embedded!

Related

Is there a way to force Facebook to show the og:image on shared links?

We have a Facebook app that generates custom shareable links for users when they complete certain activities. The shareable pages have the following meta tags:
<meta property="fb:admins" content="1000000000000000">
<meta property="fb:app_id" content="1000000000000000">
<meta property="og:site_name" content="ActivityApp">
<meta property="og:title" content="I just completed this activity.">
<meta property="og:description" content="Click here to see John's activity!">
<meta property="og:type" content="website">
<meta property="og:url" content="http://activity.com/abcd69478383951886c14ae">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="800">
<meta property="og:image:height" content="420">
<meta property="og:image" content="http://cdn.com/abcd69478383951886c14ae.png">
<meta name="author" content="John">
Most of the time, Facebook will correctly show the title, description, and image on the Newsfeed when the links are shared. But sometimes, the og:image and og:title will be hidden for no reason. This is what it looks like...
The strange part is that when we check the link on the debugger by clicking Show existing scrape information it would say that it was correctly scraped and would display the title, image, and description at the bottom.
Why does this happen, and what can we do to make sure that our links will display correctly every time they are shared?
Additional info: our app generates millions of stories so we can't manually do anything to the links.
I still cannot post comments, so I try to give my answer: try using og:image:url instead of og:image. I know they should be the same, but sometimes it works.
link to answer
Read and try any of these:
https://photographylife.com/how-to-make-facebook-show-images-in-links
http://www.addthis.com/academy/how-to-optimize-facebook-sharing/
There are plenty of suggestions that you can try but I don't have concrete knowledge about that so you can search for more information in the google page.
People used to work on this:
https://developers.facebook.com/tools/debug/og/object/
But you can also try this:
https://developers.facebook.com/tools/debug/sharing
If you still can't make the image there, then it must be something wrong with your website. Unless you can provide an actual link to your resource, I can't do any further help.

Video not playing in Facebook News Feed

UPDATE: It turns out the page shouldn't have both the "og:video" and "og:video:url" tags. I removed one of them and everything worked as it should.
Problem Statement
I have a page with OpenGraph tags to allow play a video in the Facebook News feed. Sharing the URL to Facebook appears to work, but the video does not properly play.
OpenGraph Tags
<meta property="og:title" content="Jamie McMurray Ready to Defend Rolex 24 Title">
<meta property="og:url" content="http://media.weei.com/theme/9084/a/112508981/jamie-mcmurray-ready-to-defend-rolex-24-title.htm">
<meta property="og:image" content="http://media.weei.com/hosting/media/weei/1640379/mrn-autoracingpodcast-300x300.png">
<meta property="og:site_name" content="WEEI">
<meta property="og:description" content="He and his Chip Ganassi teammates are back together one year removed from winning a watch in the Rolex 24.">
<meta property="og:video" content="https://dih1l34ei3029.cloudfront.net/56275703/audiogram.mp4">
<meta property="og:video:url" content="https://dih1l34ei3029.cloudfront.net/56275703/audiogram.mp4">
<meta property="og:video:secure_url" content="https://dih1l34ei3029.cloudfront.net/56275703/audiogram.mp4">
<meta property="og:video:type" content="video/mp4">
<meta property="og:video:width" content="300">
<meta property="og:video:height" content="300">
According to the Facebook Debugger, FB is picking up the necessary tags.
Outcome
When I attempt to embed the page in Facebook, it looks like it's trying to play the video.
But when I click the Play icon, it doesn't work.
I haven't been able to find any guidance online as to why these videos aren't playing. I've double checked the tags, inspected the video codecs... everything looks like it should be working.
But it's not.
Any guidance you can provide would be greatly appreciated.
It turns out the page shouldn't have both the "og:video" and "og:video:url" tags. I removed one of them and everything worked as it should.

The image to show when a web page is shared in facebook

I've a web page and I want to share it in facebook but the image shown is not ok.
In the HTML code of the web I have:
<link href="http://www.example.com/img/logo2.png" rel="image_src" />
In the options to select the image, there are other images, but not logo2.png
I've tried to delete facebook cache with facebook debugger, but the result is the same.
Edit:
If I add ?v=1 to the end the URL when I share it, the logo option is shown. It means that facebook debugger is not deleting the cache.
Also, I want that the logo image be the first option.
Can you help me?
Solved:
<!-- facebook tags -->
<meta property="og:image" content="http://www.example.com/img/logo.png"/>
<meta property="og:url" content="http://example.com">
<meta property="og:title" content="Portfolio | web">
<meta property="og:description" content="Portfolio">
I think that you may be using the wrong tag. I haven't done this in a while, but I believe that it should be a <meta tag with a property="og:image" and then content set to your image. The following (really old) question addresses this issue/conforms to what I remember: How does Facebook Sharer select Images and other metadata when sharing my URL?
Let me know if it works :)

Facebook og fix to display just one thumbnail in sharer.php

I want to share a video with a thumbnail of only one image via sharer.php
I understand that most of people use Feed dialog with flexible UI but I need advanced options in this case.
A dialog looks like this and I want to have only one thumbnail the on I specify with og:image on a relative page
My OG tags look like this:
<meta property="fb:admins" content="*admins*" />
<meta property="fb:app_id" content="*app_id*" />
<meta property="og:type" content="movie" />
<meta property="og:video:height" content="*height*" />
<meta property="og:video:width" content="*width*" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:title" content="*title*" />
<meta property="og:description" content="*description*" />
<meta property="og:image" content="*image*" />
<meta property="og:url" content="*url*" />
<meta property="og:video" content="*video*" />
And I use a basic function to call a Share This Link dialog
u = $(*link*).html();
t = $(*name*).html();
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=*width*,height=*height*');
return false;
My question is how can I modify my code / add code to have only 1 thumbnail instead of 1 of 2 message
I tried changing my code, removing og:url, checking og:image, etc, using facebook debugger to clear its cache. And I could find nothing on net either.
I've been told you have to modify the code in (meta property="og:image" content="image" /) to
(meta property="og:image" content="http://www.yoursite.location of the image" /)
I've personally messed with this for several days and finally accomplished it! The way I did it was to publish the image I wanted FB to use for my site to my server. Then, in my browser, I did a right-click on the newly published image and chose "Copy image location". Then I added the above code to my page html between the header tags, and pasted the copied image location between the quotes. Be sure that your image is at least 200 x 200 px - they say the bigger the better, but not more that 5MB in size. I was having a lot of trouble getting FB to pick my specified image because I was making it too small. I've finally gotten success just now by resizing my image to 1000x712, and it's working.
In my case, Facebook has still not recognized my specified image as the ONLY image I want used, but I've also been told that FB will "scrape" my site every 24 hours and, hopefully, once that's done, the multiple images option will disappear. Hope this helps.

Open graph og:video Meta Tags content

I'm trying to set up a page which can be properly scraped by Facebook when it's shared/liked. The page will have a YouTube video associated with it, so in the content attribute of the og:video tag, should I put the YouTube video embed link or the actual youtube page link for it to appear on Facebook with the little "Preview" button that plays the video in Facebook?
Hope someone can help! Thanks!
You have two options. You can either set the og:video to https://www.youtube.com/v/YOUTUBECODE or set the og:url to the YouTube page.
In my examples, I'm embedding this video https://www.youtube.com/v/BQBjVr1iHH4 in the following page https://www.keithandthegirl.com/vip/bonus/episode/9/40/this-is-40. I would like Facebook to show the YouTube video whenever anyone shares my page on Facebook.
Option 1: setting the og:video to https://www.youtube.com/v/YOUTUBECODE
The meta tag will look like
<meta property='og:video' content='https://www.youtube.com/v/BQBjVr1iHH4' />
Notice the structure of the YouTube URL is different than the typical URL. You will need to isolate the "v" query from the YouTube link and use it in the og:video link format I showed above. In my example, the value of v is BQBjVr1iHH4.
Option 2: setting the og:url to the YouTube page.
If you don't have the ability to isolate the v code, you can set the og:url tag to the YouTube page. In my example, it would look like this:
<meta property='og:url' content='https://www.youtube.com/watch?v=BQBjVr1iHH4' />
This will tell Facebook to get the Open Graph tags from https://www.youtube.com/watch?v=BQBjVr1iHH4 and use that in the embed. That means the description and title will come from the YouTube page. However, if someone clicks the link, they'll go to your website.
In my example, if someone pastes the following link while I use the second option https://www.keithandthegirl.com/vip/bonus/episode/9/40/this-is-40 Facebook will see the URL is set to YouTube and query that YouTube link for the OG info. Everything will look like YouTube except the link will click to https://www.keithandthegirl.com/vip/bonus/episode/9/40/this-is-40
One other note: make sure to use https, not http. Facebook will not embed any non-secure video on the site.
Here's what I found:
Using Facebook's Open Graph Protocol, Publisher can now use any video from any URL, as long as the URL has correctly formatted metadata in the <head> of its HTML. Here's the list of information that should be in the <head>:
Thumbnail image's URL:
<meta property="og:image" content="image_src URL">
Video file URL (e.g. SWF, MP4, ..):
<meta property="og:video" content="video_src URL">
Your page's URL:
<meta property="og:url" content="URL">
Title:
<meta property="og:title" content="title">
Description:
<meta property="og:description" content="description">
Video pixel width:
<meta property="og:video:width" content="video_width">
Video pixel height:
<meta property="og:video:height" content="video_height">
Content Type:
<meta property="og:type" content="video">
You can see from the source code of a YouTube page, the og:video tag is in the following format
<meta property="og:video" content="http://www.youtube.com/v/k86xpd26M2g">
You can also see an example of the metadata used from YouTube simplified in the source code of the following URL: http://fb.stevelarsen.co.uk/example.html
You can read more about the Open Graph protocol here: http://ogp.me/
<html xmlns:og="http://ogp.me/ns#">
<head>
<!-- ... -->
<!-- [REQUIRED TAGS] -->
<meta property="og:video" content="http://example.com/awesome.flv" />
<meta property="og:video:height" content="640" />
<meta property="og:video:width" content="385" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
...
</head>
The link of the .flv file.... check out https://developers.facebook.com/docs/opengraph/#types
For those who stumbled at the debugger provided by facebook please note the following:
When you are logged into the debugger you are under https session. In order to see your video in the debugging you need to add the secure url for video in meta. Adding youtube videos is easy, simply put the page url in og:url and it will work.
Spent and hour to come to this conclusion. Its too late I am too tired, wanna sleep now :)
I figured it out. I had a look at how Collegehumor.com does it and they include a bunch of stuff not mentioned in the Facebook API. Rather than just the following:
<meta name="og:video" content="whatever"></meta>
<meta name="video_style" content="whatever"></meta>
<meta name="video_height" content="whatever"></meta>
<meta name="video_width" content="whatever"></meta>
you also need link rel="video_src" and it helps to have videothumbnail and og:image too - I'm not entirely sure which one did it but there you go. That works :)