summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-13 14:42:39 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-13 14:42:39 -0500
commitf4ba83c576cc0752668a302e0d4bb8cf268b6eb6 (patch)
treebfcada0293e892c8ec7a3b65049122a9d65b3d15
parent35779b5540f23c4bb6ed2ef6f612447a89abec70 (diff)
parent199747397935610d5c4232ab96c4be841116409a (diff)
Merge branch 'link-fixes' into rich-media
-rw-r--r--lib/pleroma/web/rich_media/parser.ex7
-rw-r--r--lib/pleroma/web/rich_media/parser/card.ex20
-rw-r--r--test/fixtures/rich_media/wordpress.html584
-rw-r--r--test/fixtures/rich_media/wordpress_embed.json1
-rw-r--r--test/pleroma/web/rich_media/parser/card_test.exs81
-rw-r--r--test/pleroma/web/rich_media/parser_test.exs40
6 files changed, 720 insertions, 13 deletions
diff --git a/lib/pleroma/web/rich_media/parser.ex b/lib/pleroma/web/rich_media/parser.ex
index 66c90682c..0532e51ad 100644
--- a/lib/pleroma/web/rich_media/parser.ex
+++ b/lib/pleroma/web/rich_media/parser.ex
@@ -4,7 +4,6 @@
defmodule Pleroma.Web.RichMedia.Parser do
require Logger
- alias Pleroma.Web.RichMedia.Parser.Card
alias Pleroma.Web.RichMedia.Parser.Embed
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
@@ -145,8 +144,7 @@ defmodule Pleroma.Web.RichMedia.Parser do
{:ok, %Tesla.Env{body: json}} <-
Pleroma.Web.RichMedia.Helpers.oembed_get(oembed_url),
{:ok, data} <- Jason.decode(json),
- embed <- %Embed{url: url, oembed: data},
- {:ok, %Card{}} <- Card.validate(embed) do
+ embed <- %Embed{url: url, oembed: data} do
{:ok, embed}
else
{:error, error} -> {:error, error}
@@ -157,8 +155,7 @@ defmodule Pleroma.Web.RichMedia.Parser do
defp fetch_document(url) do
with {:ok, %Tesla.Env{body: html}} <- Pleroma.Web.RichMedia.Helpers.rich_media_get(url),
{:ok, html} <- Floki.parse_document(html),
- %Embed{} = embed <- parse_embed(html, url),
- {:ok, %Card{}} <- Card.validate(embed) do
+ %Embed{} = embed <- parse_embed(html, url) do
{:ok, embed}
else
{:error, error} -> {:error, error}
diff --git a/lib/pleroma/web/rich_media/parser/card.ex b/lib/pleroma/web/rich_media/parser/card.ex
index b29db730b..528837614 100644
--- a/lib/pleroma/web/rich_media/parser/card.ex
+++ b/lib/pleroma/web/rich_media/parser/card.ex
@@ -40,8 +40,8 @@ defmodule Pleroma.Web.RichMedia.Parser.Card do
html: sanitize_html(oembed["html"]),
width: oembed["width"],
height: oembed["height"],
- image: get_image(oembed) |> proxy(),
- embed_url: oembed["url"] |> proxy()
+ image: get_image(oembed) |> fix_uri(url) |> proxy(),
+ embed_url: oembed["url"] |> fix_uri(url) |> proxy()
}
|> validate()
end
@@ -56,7 +56,7 @@ defmodule Pleroma.Web.RichMedia.Parser.Card do
type: "link",
provider_name: uri.host,
provider_url: "#{uri.scheme}://#{uri.host}",
- image: get_image(embed) |> proxy()
+ image: get_image(embed) |> fix_uri(url) |> proxy()
}
|> validate()
end
@@ -112,12 +112,24 @@ defmodule Pleroma.Web.RichMedia.Parser.Card do
defp stringify_keys(%{} = map), do: Map.new(map, fn {k, v} -> {Atom.to_string(k), v} end)
+ def fix_uri("http://" <> _ = uri, _base_uri), do: uri
+ def fix_uri("https://" <> _ = uri, _base_uri), do: uri
+ def fix_uri("/" <> _ = uri, base_uri), do: URI.merge(base_uri, uri) |> URI.to_string()
+ def fix_uri("", _base_uri), do: nil
+
+ def fix_uri(uri, base_uri) when is_binary(uri),
+ do: URI.merge(base_uri, "/#{uri}") |> URI.to_string()
+
+ def fix_uri(_uri, _base_uri), do: nil
+
defp proxy(url) when is_binary(url), do: Pleroma.Web.MediaProxy.url(url)
defp proxy(_), do: nil
def validate(%Card{type: type, html: html} = card)
when type in ["video", "rich"] and (is_binary(html) == false or html == "") do
- {:error, {:invalid_metadata, card}}
+ card
+ |> Map.put(:type, "link")
+ |> validate()
end
def validate(%Card{type: type, title: title} = card)
diff --git a/test/fixtures/rich_media/wordpress.html b/test/fixtures/rich_media/wordpress.html
new file mode 100644
index 000000000..68d28e7e6
--- /dev/null
+++ b/test/fixtures/rich_media/wordpress.html
@@ -0,0 +1,584 @@
+<!DOCTYPE html>
+<!--[if lt IE 7 ]><html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ie ie6 lte7 lte8 lte9 control-height"><![endif]-->
+<!--[if IE 7 ]><html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ie ie7 lte7 lte8 lte9 control-height"><![endif]-->
+<!--[if IE 8 ]><html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ie ie8 lte8 lte9 control-height"><![endif]-->
+<!--[if IE 9 ]><html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ie ie9 lte9 control-height"><![endif]-->
+<!--[if (gt IE 9)|!(IE)]><!--><html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js control-height lazy-loading"><!--<![endif]-->
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width" />
+
+ <title>
+ Mexican Drug Cartel Animation — by I Shot Him </title>
+
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
+ <link rel="shortcut icon" href="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/favicon.ico" />
+ <link rel="stylesheet" type="text/css" media="all" href="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/style.css" />
+ <link rel="pingback" href="https://ishothim.com/xmlrpc.php" />
+
+ <link rel="stylesheet" type="text/css" media="all" href="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/css/jquery.fancybox.css" />
+
+ <script type='text/javascript' src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
+
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.animate-shadow-min.js'></script>
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.hoverflow.min.js'></script>
+
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.ba-urlinternal.js'></script>
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.history.js'></script>
+ <script type="text/javascript" src="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/modernizr.custom.57081.js"></script>
+ <script type="text/javascript" src="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/css3-mediaqueries.js"></script>
+ <script type="text/javascript" src="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.scrollTo-1.4.2-min.js"></script>
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.fancybox.js'></script>
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/jquery.fitvids.js'></script>
+
+ <script type="text/javascript" src="http://use.typekit.com/dyw3hhy.js"></script>
+ <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
+
+ <script type="text/javascript">
+
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-12050420-1']);
+ _gaq.push(['_setDomainName', 'ishothim.com']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+
+ </script>
+
+
+<meta name='robots' content='max-image-preview:large' />
+
+<!-- This site is optimized with the Yoast WordPress SEO plugin v1.4.18 - http://yoast.com/wordpress/seo/ -->
+<meta name="description" content="I Shot Him collaborated with the folks at Visual.ly on this informative animation about the violence from drug cartels happening right across our border. We researched, wrote, illustrated, and animated this piece to inform people about the connections of our drug and gun laws to the death of innocence in Mexico."/>
+<link rel="canonical" href="https://ishothim.com/our-work/mexican-drug-cartels/" />
+<meta property="og:locale" content="en_US"/>
+<meta property="og:type" content="article"/>
+<meta property="og:title" content="Mexican Drug Cartel Animation — by I Shot Him"/>
+<meta property="og:description" content="I Shot Him collaborated with the folks at Visual.ly on this informative animation about the violence from drug cartels happening right across our border. We researched, wrote, illustrated, and animated this piece to inform people about the connections of our drug and gun laws to the death of innocence in Mexico."/>
+<meta property="og:url" content="https://ishothim.com/our-work/mexican-drug-cartels/"/>
+<meta property="og:site_name" content="I Shot Him"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature-894x1050.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-894x502.jpg"/>
+<meta property="og:image" content="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-894x502.jpg"/>
+<!-- / Yoast WordPress SEO plugin. -->
+
+<link rel='dns-prefetch' href='//s.w.org' />
+<link rel="alternate" type="application/rss+xml" title="I Shot Him &raquo; Feed" href="https://ishothim.com/feed/" />
+<link rel="alternate" type="application/rss+xml" title="I Shot Him &raquo; Comments Feed" href="https://ishothim.com/comments/feed/" />
+ <script type="text/javascript">
+ window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/ishothim.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.7.2"}};
+ !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,8205,55356,57212],[55357,56424,8203,55356,57212])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings);
+ </script>
+ <style type="text/css">
+img.wp-smiley,
+img.emoji {
+ display: inline !important;
+ border: none !important;
+ box-shadow: none !important;
+ height: 1em !important;
+ width: 1em !important;
+ margin: 0 .07em !important;
+ vertical-align: -0.1em !important;
+ background: none !important;
+ padding: 0 !important;
+}
+</style>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js" onload="window.ieshiv=true;"></script>
+ <script>!window.ieshiv && document.write(unescape('%3Cscript src="https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-parent/js/ieshiv.js"%3E%3C/script%3E'))</script>
+<![endif]-->
+<link rel='stylesheet' id='wp-block-library-css' href='https://149355628.v2.pressablecdn.com/wp-includes/css/dist/block-library/style.min.css?ver=5.7.2' type='text/css' media='all' />
+<link rel='stylesheet' id='contact-form-7-css' href='https://149355628.v2.pressablecdn.com/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=3.5.2' type='text/css' media='all' />
+<script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1' id='jquery-core-js'></script>
+<script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2' id='jquery-migrate-js'></script>
+<link rel="https://api.w.org/" href="https://ishothim.com/wp-json/" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://ishothim.com/xmlrpc.php?rsd" />
+<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://ishothim.com/wp-includes/wlwmanifest.xml" />
+
+<link rel='shortlink' href='https://ishothim.com/?p=1228' />
+<link rel="alternate" type="application/json+oembed" href="https://ishothim.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fishothim.com%2Four-work%2Fmexican-drug-cartels%2F" />
+<link rel="alternate" type="text/xml+oembed" href="https://ishothim.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fishothim.com%2Four-work%2Fmexican-drug-cartels%2F&#038;format=xml" />
+ </head>
+ <body class="our-work-template-default single single-our-work postid-1228 control-height">
+ <!-- DO NOT REMOVE. This is a link to the blog's homepage url. We access this in the javascript. If the wordpress blog URL changes the javascript immediately get updated. Used in Ajax loading of all posts and pages -->
+ <a href="https://ishothim.com" id="blogURL" style="display:none"></a>
+ <!-- DO NOT REMOVE.-->
+ <div id="header-container" >
+ <div class="wrap container rel-container clear">
+ <header class="logo" role="banner">
+ <a href="https://ishothim.com/" title="I Shot Him" rel="home"><img id="logo-svg" src="https://ishothim.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/img/ISH_logotype-01.svg" /></a>
+ </header>
+ <nav id="access" role="navigation" >
+ <a id="skip" href="#content" class="assistive-text" title="Skip to content">Skip to content</a>
+ <div id="menu-icon"><div id="menu-plus"></div></div>
+ <div class="menu-header"><ul id="menu-ish-nav" class="menu"><li id="menu-item-26" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-26"><a href="https://ishothim.com/work/">Work</a></li>
+<li id="menu-item-30" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-30"><a href="https://ishothim.com/about/">About</a></li>
+<li id="menu-item-29" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-29"><a href="https://ishothim.com/contact/">Contact</a></li>
+<li id="menu-item-28" class="menu-item menu-item-type-post_type menu-item-object-page current_page_parent menu-item-28"><a href="https://ishothim.com/blog/">News</a></li>
+</ul></div> </nav><!-- #access -->
+ </div>
+ </div><!-- #header-container -->
+ <div id="ie-turd-storm-container">
+
+ <div id="butt-box">
+ <div id="butt-inner">
+
+ </div>
+ </div>
+ <div id="poo-box">
+ <div id="inner-poo-container">
+ <div id="poo-cap"></div>
+ <div id="poo-log"></div>
+ </div>
+
+ </div>
+ <div id="poo-wall">
+ <div id="turd-message-container">
+ <h2 id="turd-title">Look what you did ya li'l turd!</h2>
+ <div id="turd-message">
+ Everyone knows Internet Explorer turns the internet into a steaming hot pile of smelly poo poo.
+ </div>
+ <div id="turd-footer">
+ Avoid the fecal fest and use a <a href="http://www.google.com/chrome/intl/en/landing_chrome.html" title="Google Chrome" target="_blank">sanitary browser</a> like a big boy.
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="ajax-container" class="control-height">
+ <section id="content" role="main" data-title="Mexican Drug Cartel Animation — by I Shot Him" class="our-work-template-default single single-our-work postid-1228 clear control-height">
+
+ <article id="post-1228" class="single-post post-1228 our-work type-our-work status-publish has-post-thumbnail hentry category-featured category-illustration category-large-thumbnail category-motion tag-animation tag-illustration-2 tag-news-2">
+ <div id="single-page-hero" class="layzy" title="Mexican Drug Cartels" data-background="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature.jpg" >
+ <div id="page-down-arrow"><div id="down-arrow-icon"></div></div>
+ <div class="horizontal-shadow-bottom-up"></div>
+ </div> <!-- #single-page-hero -->
+
+ <div id="scroll-top-detector">
+ <div id="absolute-to-fixed-bar" style="display:none;"></div>
+ </div>
+ <div id="main-content" class="entry-content wrap clear">
+
+ <div id="project-details" class="right-column post-images float-grid-item last-float-item grid3">
+
+ <div id="project-overview">
+ <h2>Mexican Drug Cartels </h2>
+ <p>We collaborated with the folks at <a href="http://visual.ly/violence-mexican-drug-cartels" target="_blank">Visual.ly</a> on this informative animation about the violence from drug cartels happening right across our border. We researched, wrote, illustrated, and animated this piece to inform people about the connections of our drug and gun laws to the death of innocents in Mexico.</p> </div>
+
+ <div id="Sharing-container">
+ <div id="fixed-detector"></div>
+ <div id="fixed-share-wrapper">
+ <div id="fixed-share-inner">
+ <div id="share-contents" class="grid3 mobile-hidden">
+ <h2>Sharing is Caring </h2>
+ push one of these totally not dorky buttons and we will owe you one.
+ <div class="share-container">
+
+ <a id="facebook-share" href="http://www.facebook.com/sharer.php?u=https://ishothim.com/our-work/mexican-drug-cartels/" title="Mexican Drug Cartels" class="facebook-icon share-icon" target="_blank" ></a>
+
+ <a id="twitter-share" href="http://twitter.com/share?text=Mexican Drug Cartels" title="Mexican Drug Cartels" class="twitter-icon share-icon" target="_blank"></a>
+
+ <a id="pinterest-share" class="pinterest-icon share-icon" href='javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());'></a>
+ </div>
+ </div>
+ </div>
+ </div> <!-- #fixed-share-wrapper -->
+ </div>
+
+ </div><!-- #project-details -->
+
+ <div id="project-images" class="left-column post-images float-grid-item grid9">
+ <div class="hidden"><img width="1680" height="1050" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature.jpg" class="attachment-full lazy-source size-full lazy-source wp-post-image" alt="" loading="lazy" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature.jpg 1680w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature-589x368.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature-894x558.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature-792x495.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_feature-1200x750.jpg 1200w " sizes="(max-width: 1680px) 100vw, 1680px" /></div>
+ <p><iframe loading="lazy" src="http://www.youtube.com/embed/OAfEq80YlWU" height="503" width="894" allowfullscreen="" frameborder="0"></iframe></p>
+<h2>Animation</h2>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1230" alt="Mexican Cartel Animation - by I Shot Him" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-01.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Title Screen</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1232" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-03.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Beheadings</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1235" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-06.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Cartel Member</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1236" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-07.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Death Toll</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1237" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-08.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Mass Grave</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1239" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-10.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Death toll of police officers</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1241" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-12.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Molotov cocktail used to burn down houses</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1245" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-16.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>We do a bunch of drugs</h3>
+<p><a class="ish-img" href="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22.jpg" rel="lightbox" title="Mexican Drug Cartels"><img loading="lazy" class="alignnone size-medium wp-image-1251" alt="Cartel_storyboard" src="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-894x502.jpg" width="894" height="502" srcset="https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-894x502.jpg 894w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-589x331.jpg 589w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-792x445.jpg 792w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22-1200x675.jpg 1200w , https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/01/Cartel_stills-22.jpg 1280w " sizes="(max-width: 894px) 100vw, 894px" /></a></p>
+<h3>Obama needs to step up and change gun laws and drug laws</h3>
+ </div><!-- #project-images -->
+
+ <div id="mobile-share-contents" class="grid3 mobile-visible">
+ <h2>Sharing is Caring </h2>
+ push one of these totally not dorky buttons and we will owe you one.
+ <div class="share-container">
+
+ <a id="facebook-share" href="http://www.facebook.com/sharer.php?u=https://ishothim.com/our-work/mexican-drug-cartels/" title="Mexican Drug Cartels" class="facebook-icon share-icon" target="_blank" ></a>
+
+ <a id="twitter-share" href="http://twitter.com/share?text=Mexican Drug Cartels" title="Mexican Drug Cartels" class="twitter-icon share-icon" target="_blank"></a>
+
+ <a id="pinterest-share" class="pinterest-icon share-icon" href='javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());'></a>
+ </div>
+ </div>
+
+ <div id="more-projects" class="float-grid-item grid9">
+ <div id="more-shadow-top" class="shadow-border"></div>
+ <div id="more-projects-title">
+
+ <div id="more-drawer-link">
+ <div class="more-drawer-line"></div>
+ <div class="more-drawer-text">
+ More Projects
+ </div>
+ </div>
+
+
+ <a href="https://ishothim.com/our-work/fair-trade-universities/" id="more-arrow-left" title="">
+ <div class="more-projects-circle">
+ <img class="circle-image-left" src="https://ishothim.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/img/more-arrow-left.svg" />
+ </div>
+ </a>
+ <a href="https://ishothim.com/our-work/posters/" id="more-arrow-right" title="">
+ <div class="more-projects-circle">
+ <img class="circle-image-right" src="https://ishothim.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/img/more-arrow-right.svg" />
+ </div>
+ </a>
+
+ </div>
+
+ <div id="more-projects-inner" class="clear">
+
+ <div class="more-work-image float-grid-item num1 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/cultivated-wit/" title="Permalink to Cultivated Wit" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/09/CultivatedWit_thumb2.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/cultivated-wit/" title="Permalink to Cultivated Wit" rel="bookmark">Cultivated Wit</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num2 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/fair-trade-universities/" title="Permalink to Fair Trade Universities" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2013/09/fairtrade_thumb.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/fair-trade-universities/" title="Permalink to Fair Trade Universities" rel="bookmark">Fair Trade Universities</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num3 odd-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/posters/" title="Permalink to Posters" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_posters2.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/posters/" title="Permalink to Posters" rel="bookmark">Posters</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num4 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/nyc-readiness-challenge/" title="Permalink to NYC Readiness Challenge" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/10/thumb_nyc2.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/nyc-readiness-challenge/" title="Permalink to NYC Readiness Challenge" rel="bookmark">NYC Readiness Challenge</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num5 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/sf-aids-prep/" title="Permalink to SF AIDS Foundation" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_sfaids.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/sf-aids-prep/" title="Permalink to SF AIDS Foundation" rel="bookmark">SF AIDS Foundation</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num6 even-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/the-great-peace/" title="Permalink to The Great Peace" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumbs_thegreatpeace3.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/the-great-peace/" title="Permalink to The Great Peace" rel="bookmark">The Great Peace</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num7 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/food-truck-brunch-box/" title="Permalink to Brunch Box Food Truck" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_brunchbox.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/food-truck-brunch-box/" title="Permalink to Brunch Box Food Truck" rel="bookmark">Brunch Box Food Truck</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num8 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/massive-health/" title="Permalink to Massive Health" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_massivehealth2.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/massive-health/" title="Permalink to Massive Health" rel="bookmark">Massive Health</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num9 odd-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/eat-real-fest/" title="Permalink to Eat Real Fest" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_eatreal.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/eat-real-fest/" title="Permalink to Eat Real Fest" rel="bookmark">Eat Real Fest</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num10 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/the-help/" title="Permalink to The Help" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_thehelp.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/the-help/" title="Permalink to The Help" rel="bookmark">The Help</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num11 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/sexy-sex-sex-posters/" title="Permalink to Sexy Sex Sex Posters" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_sex2.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/sexy-sex-sex-posters/" title="Permalink to Sexy Sex Sex Posters" rel="bookmark">Sexy Sex Sex Posters</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num12 even-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/sfpark/" title="Permalink to SFpark" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_sfpark1.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/sfpark/" title="Permalink to SFpark" rel="bookmark">SF<em>park</em></a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num13 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/the-new-leaf/" title="Permalink to The New Leaf" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_thenewleaf.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/the-new-leaf/" title="Permalink to The New Leaf" rel="bookmark">The New Leaf</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num14 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/emotional-equations/" title="Permalink to Emotional Equations" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_ee.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/emotional-equations/" title="Permalink to Emotional Equations" rel="bookmark">Emotional Equations</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num15 odd-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/the-black-harbor/" title="Permalink to The Black Harbor" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_tbh.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/the-black-harbor/" title="Permalink to The Black Harbor" rel="bookmark">The Black Harbor</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num16 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/artpadsf/" title="Permalink to ArtPadSF" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_artpad.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/artpadsf/" title="Permalink to ArtPadSF" rel="bookmark">ArtPadSF</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num17 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/wolf-badger/" title="Permalink to Wolf &#038; Badger" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_wb.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/wolf-badger/" title="Permalink to Wolf &#038; Badger" rel="bookmark">Wolf &#038; Badger</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num18 even-post grid3 last-float-item"> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/artist-interviews/" title="Permalink to Artist Interviews" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_artistinterview.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/artist-interviews/" title="Permalink to Artist Interviews" rel="bookmark">Artist Interviews</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num19 odd-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/auditory-visual/" title="Permalink to Auditory Visual" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_music.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/auditory-visual/" title="Permalink to Auditory Visual" rel="bookmark">Auditory Visual</a>
+ </div>
+
+
+ <div class="more-work-image float-grid-item num20 even-post grid3 "> <a class="more-link box-shadow-subtle" href="https://ishothim.com/our-work/quake-quiz-sf/" title="Permalink to Quake Quiz SF" rel="bookmark" style='background:url("https://149355628.v2.pressablecdn.com/wp-content/uploads/2012/07/thumb_qq.jpg")'>
+
+ </a>
+ <a class="more-link-title" href="https://ishothim.com/our-work/quake-quiz-sf/" title="Permalink to Quake Quiz SF" rel="bookmark">Quake Quiz SF</a>
+ </div>
+
+
+
+ </div>
+
+ <div id="more-shadow-bottom" class="shadow-border"></div>
+ </div>
+
+
+ </div><!-- #main-content -->
+
+
+
+ <div id="more-projects-container" class="wrap clear">
+
+
+ </div>
+ </article><!-- #post-## -->
+
+ </section><!-- #main -->
+ </div><!-- #ajax-container -->
+ <footer role="contentinfo" class="clear">
+ <div class="horizontal-shadow-top"></div>
+ <div id="footer-content-container" class="wrap container clear">
+
+
+
+
+ <div id="footer-contact" class="footer-column float-grid-item grid4-box">
+ <h3>Contact</h3>
+ <div class="contact-labels">
+ <div class="indiv-contact-label">Phone:</div>
+ <div class="indiv-contact-label">Email:</div>
+ <div class="indiv-contact-label">Addy:</div>
+ </div>
+ <div class="contact-values">
+ <div class="indiv-contact-label">415.829.7482</div>
+ <div class="indiv-contact-label"><a href="mailto:Info@IShotHim.com">Info@IShotHim.com</a></div>
+ <div class="indiv-contact-label">777 Florida St, #308 San Francisco, CA 94110</div>
+ </div>
+ </div>
+
+ <div id="footer-follow" class="footer-column center-column-border float-grid-item grid4-box">
+
+ <h3>Follow</h3>
+ <div id="follow-links">
+ <div class="follow-facebook footer social-link"><a class="follow-link" href="http://facebook.com/ishothimbecauseilovedhimdamnhim" target="_blank"></a></div>
+ <div class="follow-twitter footer social-link"><a class="follow-link" href="https://twitter.com/ishothim" target="_blank"></a></div>
+ <div class="follow-pinterest footer social-link"><a class="follow-link" href="http://pinterest.com/thewellarmed/" target="_blank"></a></div>
+ <div class="follow-dribbble footer social-link"><a class="follow-link" href="http://dribbble.com/thewellarmed" target="_blank"></a></div>
+ </div>
+ <div id="newsletter-container" class="clear">
+ <div class="wpcf7" id="wpcf7-f489-p230-o1"><form action="/our-work/art-crank/#wpcf7-f489-p230-o1" method="post" class="wpcf7-form">
+ <div style="display: none;">
+ <input type="hidden" name="_wpcf7" value="489" />
+ <input type="hidden" name="_wpcf7_version" value="3.3.1" />
+ <input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f489-p230-o1" />
+ <input type="hidden" name="_wpnonce" value="bd7e66b398" />
+ </div>
+ <p><span class="wpcf7-form-control-wrap your-email">
+ <div id="newsletter-text">Newsletter</div><input type="text" name="your-email" value="" id="newsletter-input" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-email wpcf7-use-title-as-watermark" size="40" title="Enter Your Email" /></span></p>
+ <div class="wpcf7-response-output wpcf7-display-none"></div></form></div>
+ </div>
+
+ </div>
+
+ <div id="footer-colophon" class="footer-column float-grid-item grid4-box last-float-item">
+ <h3>Colophon</h3>
+ <div id="colophon-upper" class="clear">
+ <div id="typefaces-label" class="colophon-label">
+ Typefaces
+ </div>
+
+ <div id="type-one" class="colophon-label">
+ Signalist
+ <div class="type-designer">
+ By Mika Melvas
+ </div>
+ </div>
+ <div id="type-two" class="colophon-label">
+ Jubilat
+ <div class="type-designer">
+ By Darden Studio
+ </div>
+ </div>
+ <div id="type-three" class="colophon-label">
+ Gesta
+ <div class="type-designer" >
+ By Rui Abreu
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div id="footer-base" class="wrap container clear">
+ <div id="legal-mumbo-jumbo">© I Shot Him All Rights Reserved</div>
+ <div id="ie-is-poopy">
+ <a href="javascript:void(0)"><div class="ie-turd-icon"></div>IE Mode</a>
+ </div>
+ </div>
+
+ </footer><!-- footer -->
+
+
+ <div id="hidden-merger-container" class="activeMerger" style="display:none;">
+ <div id="merger-background-blocker"></div>
+ <div id="hidden-merger-inner" class="container wrap">
+ <div id="hidden-merger-header" class="grid10">EXCITING NEWS!</div>
+ <div id="hidden-merger-title" class="grid10">Something amazing has happened!</div>
+ <div id="hidden-merger-copy" class="grid10">
+ <div id="merger-copy-top">
+ After 6 years of designing for good causes and good people, we are taking things to the next level. We have decided to merge with our good friends at <a href="http://cultivatedwit.com" title="Cultivated Wit">Cultivated Wit.</a> We will still be working towards a better world through design, and with our powers combined we will be able to create bigger and better things.
+ </div>
+ <div id="merger-copy-bottom">
+ We have made an <a href="http://merger.cultivatedwit.com">animation celebrating the merger</a>, and you can read more about the merger and what it means for us all on the <a href="http://www.cultivatedwit.com/merger-announcement-2">Cultivated Wit Blog.</a>
+ </div>
+
+
+ </div>
+ <div id="close-window-text" class="grid10">
+ Press (ESC) or click outside of the box to continue looking at our site.
+ </div>
+ </div>
+ </div>
+
+ <div id="hidden-poo-container" style="height:0px; width:0px; position:absolute; ">
+ <div id="hidden-butt" class="render-but-hide"></div>
+ <div id="hidden-poo-cap" class="render-but-hide"></div>
+ <div id="hidden-poo-log" class="render-but-hide"></div>
+ <div id="hidden-poo-wall" class="render-but-hide"></div>
+ </div>
+
+ <div id="ie-container">
+ <div id="ie-background"></div>
+ <div id="ie-warning">
+ <h2 id="ie-title">Internet Explorer?</h2>
+ <div id="ie-message">
+ Unfortunately IE doesn't do a very good job of displaying the internet.
+ </div>
+ <div id="ie-footer">
+ We think you should consider using a different browser.
+ </div>
+ </div>
+ </div>
+
+
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/themes/ish-boilerplate/ish-boilerplate-child/js/ishothim.js'></script>
+
+
+ <script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-includes/js/comment-reply.min.js?ver=5.7.2' id='comment-reply-js'></script>
+<script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.40.0-2013.08.13' id='jquery-form-js'></script>
+<script type='text/javascript' id='contact-form-7-js-extra'>
+/* <![CDATA[ */
+var _wpcf7 = {"loaderUrl":"https:\/\/ishothim.com\/wp-content\/plugins\/contact-form-7\/images\/ajax-loader.gif","sending":"Sending ...","cached":"1"};
+/* ]]> */
+</script>
+<script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=3.5.2' id='contact-form-7-js'></script>
+<script type='text/javascript' src='https://149355628.v2.pressablecdn.com/wp-includes/js/wp-embed.min.js?ver=5.7.2' id='wp-embed-js'></script>
+ <script type="text/javascript">
+ (function() {
+ var t = document.createElement( 'script' );
+ t.type = 'text/javascript';
+ t.async = true;
+ t.id = 'gauges-tracker';
+ t.setAttribute( 'data-site-id', '571f9e29bb922a456b01916a' );
+ t.src = '//secure.gaug.es/track.js';
+ var s = document.getElementsByTagName( 'script' )[0];
+ s.parentNode.insertBefore( t, s );
+ })();
+ </script>
+
+ </body>
+</html>
+<!--
+ generated 184 seconds ago
+ generated in 0.185 seconds
+ served from batcache in 0.002 seconds
+ expires in 116 seconds
+-->
diff --git a/test/fixtures/rich_media/wordpress_embed.json b/test/fixtures/rich_media/wordpress_embed.json
new file mode 100644
index 000000000..51cd6c3c1
--- /dev/null
+++ b/test/fixtures/rich_media/wordpress_embed.json
@@ -0,0 +1 @@
+{"version":"1.0","provider_name":"I Shot Him","provider_url":"https:\/\/ishothim.com","author_name":"Michael Jeter","author_url":"https:\/\/ishothim.com\/author\/mike\/","title":"Mexican Drug Cartels","type":"rich","width":600,"height":338,"html":"<blockquote class=\"wp-embedded-content\"><a href=\"https:\/\/ishothim.com\/our-work\/mexican-drug-cartels\/\">Mexican Drug Cartels<\/a><\/blockquote>\n<script type='text\/javascript'>\n<!--\/\/--><![CDATA[\/\/><!--\n\t\t\/*! This file is auto-generated *\/\n\t\t!function(c,d){\"use strict\";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),n=d.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),o=0;o<n.length;o++)n[o].style.display=\"none\";for(o=0;o<s.length;o++)if(r=s[o],e.source===r.contentWindow){if(r.removeAttribute(\"style\"),\"height\"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;r.height=i}if(\"link\"===t.message)if(a=d.createElement(\"a\"),i=d.createElement(\"a\"),a.href=r.getAttribute(\"src\"),i.href=t.value,i.host===a.host)if(d.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener(\"message\",c.wp.receiveEmbedMessage,!1),d.addEventListener(\"DOMContentLoaded\",t,!1),c.addEventListener(\"load\",t,!1);function t(){if(!n){n=!0;for(var e,t,r=-1!==navigator.appVersion.indexOf(\"MSIE 10\"),a=!!navigator.userAgent.match(\/Trident.*rv:11\\.\/),i=d.querySelectorAll(\"iframe.wp-embedded-content\"),s=0;s<i.length;s++){if(!(e=i[s]).getAttribute(\"data-secret\"))t=Math.random().toString(36).substr(2,10),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t);if(r||a)(t=e.cloneNode(!0)).removeAttribute(\"security\"),e.parentNode.replaceChild(t,e)}}}}(window,document);\n\/\/--><!]]>\n<\/script><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/ishothim.com\/our-work\/mexican-drug-cartels\/embed\/\" width=\"600\" height=\"338\" title=\"&#8220;Mexican Drug Cartels&#8221; &#8212; I Shot Him\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe>","thumbnail_url":"https:\/\/ishothim.com\/wp-content\/uploads\/2013\/01\/Cartel_feature.jpg","thumbnail_width":600,"thumbnail_height":375} \ No newline at end of file
diff --git a/test/pleroma/web/rich_media/parser/card_test.exs b/test/pleroma/web/rich_media/parser/card_test.exs
index e09dfa6db..07d367084 100644
--- a/test/pleroma/web/rich_media/parser/card_test.exs
+++ b/test/pleroma/web/rich_media/parser/card_test.exs
@@ -32,6 +32,49 @@ defmodule Pleroma.Web.RichMedia.Parser.CardTest do
assert Card.parse(embed) == {:ok, expected}
end
+
+ test "converts URL paths into absolute URLs" do
+ embed = %Embed{
+ url: "https://spam.com/luigi",
+ title: "Watch Luigi not doing anything",
+ meta: %{
+ "og:image" => "/uploads/weegee.jpeg"
+ }
+ }
+
+ {:ok, card} = Card.parse(embed)
+ assert card.image == "https://spam.com/uploads/weegee.jpeg"
+ end
+
+ test "falls back to Link with invalid Rich/Video" do
+ url = "https://ishothim.com/our-work/mexican-drug-cartels/"
+ oembed = File.read!("test/fixtures/rich_media/wordpress_embed.json") |> Jason.decode!()
+
+ embed =
+ File.read!("test/fixtures/rich_media/wordpress.html")
+ |> Floki.parse_document!()
+ |> TwitterCard.parse(%Embed{url: url, oembed: oembed})
+
+ expected = %Card{
+ author_name: "Michael Jeter",
+ author_url: "https://ishothim.com/author/mike/",
+ blurhash: nil,
+ description:
+ "I Shot Him collaborated with the folks at Visual.ly on this informative animation about the violence from drug cartels happening right across our border. We researched, wrote, illustrated, and animated this piece to inform people about the connections of our drug and gun laws to the death of innocence in Mexico.",
+ embed_url: nil,
+ height: 338,
+ html: "",
+ image: "https://ishothim.com/wp-content/uploads/2013/01/Cartel_feature.jpg",
+ provider_name: "I Shot Him",
+ provider_url: "https://ishothim.com",
+ title: "Mexican Drug Cartels",
+ type: "link",
+ url: "https://ishothim.com/our-work/mexican-drug-cartels/",
+ width: 600
+ }
+
+ assert Card.parse(embed) == {:ok, expected}
+ end
end
describe "validate/1" do
@@ -45,4 +88,42 @@ defmodule Pleroma.Web.RichMedia.Parser.CardTest do
assert {:ok, ^card} = Card.validate(card)
end
end
+
+ describe "fix_uri/2" do
+ setup do: %{base_uri: "https://benis.xyz/hello/fam"}
+
+ test "two full URLs", %{base_uri: base_uri} do
+ uri = "https://benis.xyz/images/pic.jpeg"
+ assert Card.fix_uri(uri, base_uri) == uri
+ end
+
+ test "URI with leading slash", %{base_uri: base_uri} do
+ uri = "/images/pic.jpeg"
+ expected = "https://benis.xyz/images/pic.jpeg"
+ assert Card.fix_uri(uri, base_uri) == expected
+ end
+
+ test "URI without leading slash", %{base_uri: base_uri} do
+ uri = "images/pic.jpeg"
+ expected = "https://benis.xyz/images/pic.jpeg"
+ assert Card.fix_uri(uri, base_uri) == expected
+ end
+
+ test "empty URI", %{base_uri: base_uri} do
+ assert Card.fix_uri("", base_uri) == nil
+ end
+
+ test "nil URI", %{base_uri: base_uri} do
+ assert Card.fix_uri(nil, base_uri) == nil
+ end
+
+ # https://github.com/elixir-lang/elixir/issues/10771
+ test "Elixir #10771", _ do
+ uri =
+ "https://images.macrumors.com/t/4riJyi1XC906qyJ41nAfOgpvo1I=/1600x/https://images.macrumors.com/article-new/2020/09/spatialaudiofeature.jpg"
+
+ base_uri = "https://www.macrumors.com/guide/apps-support-apples-spatial-audio-feature/"
+ assert Card.fix_uri(uri, base_uri) == uri
+ end
+ end
end
diff --git a/test/pleroma/web/rich_media/parser_test.exs b/test/pleroma/web/rich_media/parser_test.exs
index f7d010219..8506953bb 100644
--- a/test/pleroma/web/rich_media/parser_test.exs
+++ b/test/pleroma/web/rich_media/parser_test.exs
@@ -83,8 +83,15 @@ defmodule Pleroma.Web.RichMedia.ParserTest do
:ok
end
- test "returns error when no metadata present" do
- assert {:error, _} = Parser.parse("http://example.com/empty")
+ test "returns empty embed when no metadata present" do
+ expected = %Embed{
+ meta: %{},
+ oembed: nil,
+ title: nil,
+ url: "http://example.com/empty"
+ }
+
+ assert Parser.parse("http://example.com/empty") == {:ok, expected}
end
test "parses ogp" do
@@ -166,8 +173,33 @@ defmodule Pleroma.Web.RichMedia.ParserTest do
assert Parser.parse(url) == {:ok, expected}
end
- test "rejects invalid OGP data" do
- assert {:error, _} = Parser.parse("http://example.com/malformed")
+ test "cleans corrupted meta data" do
+ expected = %Embed{
+ meta: %{
+ "Keywords" => "Konsument i zakupy",
+ "ROBOTS" => "NOARCHIVE",
+ "fb:app_id" => "515714931781741",
+ "fb:pages" => "288018984602680",
+ "google-site-verification" => "3P4BE3hLw82QWqtseIE60qQcOtrpMxMnCNkcv62pjTA",
+ "news_keywords" => "Konsument i zakupy",
+ "og:image" =>
+ "https://bi.im-g.pl/im/f7/49/17/z24418295FBW,Prace-nad-projektem-chusty-antysmogowej-rozpoczely.jpg",
+ "og:locale" => "pl_PL",
+ "og:site_name" => "wyborcza.biz",
+ "og:type" => "article",
+ "og:url" =>
+ "http://wyborcza.biz/biznes/7,147743,24417936,pomysl-na-biznes-chusta-ktora-chroni-przed-smogiem.html",
+ "twitter:card" => "summary_large_image",
+ "twitter:image" =>
+ "https://bi.im-g.pl/im/f7/49/17/z24418295FBW,Prace-nad-projektem-chusty-antysmogowej-rozpoczely.jpg",
+ "viewport" => "width=device-width, user-scalable=yes"
+ },
+ oembed: nil,
+ title: nil,
+ url: "http://example.com/malformed"
+ }
+
+ assert Parser.parse("http://example.com/malformed") == {:ok, expected}
end
test "returns error if getting page was not successful" do