Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 677
Jake Avatar asked Jul 04 '15 03:07

Jake


2 Answers

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.

like image 180
vegashacker Avatar answered Sep 29 '22 10:09

vegashacker


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.

like image 28
Tim Frietas Avatar answered Sep 29 '22 12:09

Tim Frietas