Skip to content

Commit

Permalink
Embed imgur ".gifv" content.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 20, 2016
1 parent 277b4f5 commit 008457b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions feed/index.php
Expand Up @@ -137,6 +137,16 @@ function process_item($item)
$appendimg = true;
else if (strcasecmp($ext, '.gif') == 0)
$appendimg = true;
else if (strcasecmp($ext, '.gifv') == 0) // imgur "video"?
{
$embedurl = preg_replace('/^(.*?\:\/\/)(.*?\.|)(imgur\.com\/)(.*)\.gifv$/', '$1$2$3$4.gif', $url, 1);
if ($embedurl != $url)
{
$credithtml = "<br/><font size='-2'><a href='$url'>view this video at imgur.com</a></font>";
$appendimg = true;
$url = $embedurl;
} // if
} // else if

if (!$appendimg && empty($morehtml) && !empty($item['thumbnail'])) // oh well, use reddit's thumbnail if there is one.
{
Expand Down

0 comments on commit 008457b

Please sign in to comment.