Fix Cyanide & Happiness filter and add unit test
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 10 Feb 2015 20:42:34 +0000 (21:42 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 10 Feb 2015 20:42:34 +0000 (21:42 +0100)
src/main/java/net/pterodactylus/rhynodge/filters/comics/CyanideAndHappinessComicFilter.java
src/test/java/net/pterodactylus/rhynodge/filters/comics/CyanideAndHappinessComicFilterTest.java [new file with mode: 0644]
src/test/resources/net/pterodactylus/rhynodge/filters/comics/cyanide-and-happiness.html [new file with mode: 0644]

index b51e959..8cceb5c 100644 (file)
@@ -17,6 +17,9 @@
 
 package net.pterodactylus.rhynodge.filters.comics;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.Collections;
 import java.util.List;
 
@@ -39,17 +42,27 @@ public class CyanideAndHappinessComicFilter extends ComicSiteFilter {
 
        @Override
        protected Optional<String> extractTitle(Document document) {
-               return Optional.of("");
+               return Optional.absent();
        }
 
        @Override
        protected List<String> extractImageUrls(Document document) {
-               Elements imageTags = document.select("img[alt=Cyanide and Happiness, a daily webcomic]");
+               Elements imageTags = document.select("img#main-comic");
                return FluentIterable.from(imageTags).transform(new Function<Element, String>() {
 
                        @Override
                        public String apply(Element input) {
-                               return input.attr("src");
+                               String imageUrl = input.attr("src");
+                               try {
+                                       return new URI(document.baseUri()).resolve(imageUrl).toString();
+                               } catch (URISyntaxException e) {
+                                       /* ignore. */
+                               }
+                               if (!imageUrl.startsWith("/")) {
+                                       return imageUrl;
+                               }
+                               String protocol = document.baseUri().substring(0, document.baseUri().indexOf('/'));
+                               return protocol + imageUrl;
                        }
                }).toList();
        }
diff --git a/src/test/java/net/pterodactylus/rhynodge/filters/comics/CyanideAndHappinessComicFilterTest.java b/src/test/java/net/pterodactylus/rhynodge/filters/comics/CyanideAndHappinessComicFilterTest.java
new file mode 100644 (file)
index 0000000..2d7a118
--- /dev/null
@@ -0,0 +1,40 @@
+package net.pterodactylus.rhynodge.filters.comics;
+
+import java.io.IOException;
+
+import com.google.common.base.Optional;
+import org.hamcrest.MatcherAssert;
+import org.hamcrest.Matchers;
+import org.jsoup.nodes.Document;
+import org.junit.Test;
+
+/**
+ * Unit test for {@link CyanideAndHappinessComicFilter}.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class CyanideAndHappinessComicFilterTest {
+
+       private final CyanideAndHappinessComicFilter comicSiteFilter = new CyanideAndHappinessComicFilter();
+       private final Document document;
+
+       public CyanideAndHappinessComicFilterTest() throws IOException {
+               document = ComicLoader.loadDocument("cyanide-and-happiness.html", "http://www.explosm.net/comics/new/");
+       }
+
+       @Test
+       public void filterCanParseComicTitle() {
+               MatcherAssert.assertThat(comicSiteFilter.extractTitle(document), Matchers.is(Optional.absent()));
+       }
+
+       @Test
+       public void filterCanExtractImageUrls() {
+               MatcherAssert.assertThat(comicSiteFilter.extractImageUrls(document), Matchers.contains("http://files.explosm.net/comics/Dave/moneyhappiness.png"));
+       }
+
+       @Test
+       public void filterExtractNoImageComments() {
+               MatcherAssert.assertThat(comicSiteFilter.extractImageComments(document), Matchers.empty());
+       }
+
+}
diff --git a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/cyanide-and-happiness.html b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/cyanide-and-happiness.html
new file mode 100644 (file)
index 0000000..dee38e2
--- /dev/null
@@ -0,0 +1,480 @@
+<!doctype html>
+<html class="no-js" lang="en">
+<head>
+<title>Explosm.net - Home of Cyanide and Happiness</title>
+<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"/>
+<meta charset="utf-8"/><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(n,t,e){function r(e){if(!t[e]){var o=t[e]={exports:{}};n[e][0].call(o.exports,function(t){var o=n[e][1][t];return r(o?o:t)},o,o.exports)}return t[e].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<e.length;o++)r(e[o]);return r}({QJf3ax:[function(n,t){function e(n){function t(t,e,a){n&&n(t,e,a),a||(a={});for(var u=c(t),f=u.length,s=i(a,o,r),p=0;f>p;p++)u[p].apply(s,e);return s}function a(n,t){f[n]=c(n).concat(t)}function c(n){return f[n]||[]}function u(){return e(t)}var f={};return{on:a,emit:t,create:u,listeners:c,_events:f}}function r(){return{}}var o="nr@context",i=n("gos");t.exports=e()},{gos:"7eSDFh"}],ee:[function(n,t){t.exports=n("QJf3ax")},{}],gos:[function(n,t){t.exports=n("7eSDFh")},{}],"7eSDFh":[function(n,t){function e(n,t,e){if(r.call(n,t))return n[t];var o=e();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(n,t,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return n[t]=o,o}var r=Object.prototype.hasOwnProperty;t.exports=e},{}],D5DuLP:[function(n,t){function e(n,t,e){return r.listeners(n).length?r.emit(n,t,e):(o[n]||(o[n]=[]),void o[n].push(t))}var r=n("ee").create(),o={};t.exports=e,e.ee=r,r.q=o},{ee:"QJf3ax"}],handle:[function(n,t){t.exports=n("D5DuLP")},{}],XL7HBI:[function(n,t){function e(n){var t=typeof n;return!n||"object"!==t&&"function"!==t?-1:n===window?0:i(n,o,function(){return r++})}var r=1,o="nr@id",i=n("gos");t.exports=e},{gos:"7eSDFh"}],id:[function(n,t){t.exports=n("XL7HBI")},{}],loader:[function(n,t){t.exports=n("G9z0Bl")},{}],G9z0Bl:[function(n,t){function e(){var n=v.info=NREUM.info;if(n&&n.licenseKey&&n.applicationID&&f&&f.body){c(d,function(t,e){t in n||(n[t]=e)}),v.proto="https"===l.split(":")[0]||n.sslForHttp?"https://":"http://",a("mark",["onload",i()]);var t=f.createElement("script");t.src=v.proto+n.agent,f.body.appendChild(t)}}function r(){"complete"===f.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=n("handle"),c=n(1),u=window,f=u.document,s="addEventListener",p="attachEvent",l=(""+location).split("?")[0],d={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-515.min.js"},v=t.exports={offset:i(),origin:l,features:{}};f[s]?(f[s]("DOMContentLoaded",o,!1),u[s]("load",e,!1)):(f[p]("onreadystatechange",r),u[p]("onload",e)),a("mark",["firstbyte",i()])},{1:11,handle:"D5DuLP"}],11:[function(n,t){function e(n,t){var e=[],o="",i=0;for(o in n)r.call(n,o)&&(e[i]=t(o,n[o]),i+=1);return e}var r=Object.prototype.hasOwnProperty;t.exports=e},{}]},{},["G9z0Bl"]);</script>
+<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+<link rel="stylesheet" type="text/css" href="/css/MyFontsWebfontsKit.css">
+<link rel="stylesheet" href="/css/app.css"/>
+<link rel="stylesheet" href="/css/fa/css/font-awesome.css"/>
+<script src="/js/bower_components/modernizr/modernizr.js"></script>
+<meta property="fb:app_id" content="808913609170367">
+<meta property="og:site_name" content="Cyanide and Happiness">
+<meta name="apple-itunes-app" content="app-id=id368088267">
+<meta property="og:image" content="http://files.explosm.net/comics/Dave/moneyhappiness.png">
+<meta property="og:url" content="http://explosm.net/comics/3832/">
+<meta property="og:type" content="article">
+<meta property="article:publisher" content="https://www.facebook.com/explosm">
+<script type='text/javascript'>
+    var googletag = googletag || {};
+    googletag.cmd = googletag.cmd || [];
+    (function() {
+        var gads = document.createElement('script');
+        gads.async = true;
+        gads.type = 'text/javascript';
+        var useSSL = 'https:' == document.location.protocol;
+        gads.src = (useSSL ? 'https:' : 'http:') +
+        '//www.googletagservices.com/tag/js/gpt.js';
+        var node = document.getElementsByTagName('script')[0];
+        node.parentNode.insertBefore(gads, node);
+    })();
+    </script>
+<script type='text/javascript'>
+        googletag.cmd.push(function() {
+        googletag.defineSlot('/9440963/728_top_explosm', [[728, 90], [750, 100], [750, 200], [750, 300], [930, 180], [950, 90], [960, 90], [970, 66], [970, 90], [970, 250], [980, 90], [980, 120], [990, 250]], 'div-gpt-ad-1419898864153-0').addService(googletag.pubads());
+        googletag.defineSlot('/9440963/728_bottom_explosm', [[728, 90], [750, 100], [750, 200], [750, 300], [930, 180], [950, 90], [960, 90], [970, 66], [970, 90], [970, 250], [980, 90], [980, 120], [990, 250]], 'div-gpt-ad-1419898892022-0').addService(googletag.pubads());
+        googletag.defineSlot('/9440963/1_mobile_explosm', [320, 50], 'div-gpt-ad-1419899139462-0').addService(googletag.pubads());
+        googletag.defineSlot('/9440963/2_mobile_explosm', [320, 50], 'div-gpt-ad-1419899188290-0').addService(googletag.pubads());
+        googletag.defineSlot('/9440963/3_mobile_explosm', [320, 50], 'div-gpt-ad-1419899218145-0').addService(googletag.pubads());
+        googletag.defineSlot('/9440963/120_left_explosm', [[120, 60], [120, 90], [120, 240], [120, 600], [160, 600]], 'div-gpt-ad-1419898930001-0').addService(googletag.pubads());
+googletag.defineSlot('/9440963/120_right_explosm', [[120, 60], [120, 90], [120, 240], [120, 600], [160, 600]], 'div-gpt-ad-1419898959126-0').addService(googletag.pubads());
+googletag.defineSlot('/9440963/300_first_explosm', [[300, 60], [300, 100], [300, 250], [300, 600]], 'div-gpt-ad-1419899001581-0').addService(googletag.pubads());
+googletag.defineSlot('/9440963/300_second_explosm', [[300, 60], [300, 100], [300, 250], [300, 600]], 'div-gpt-ad-1419899033179-0').addService(googletag.pubads());
+googletag.defineSlot('/9440963/300_third_explosm', [[300, 60], [300, 100], [300, 250], [300, 600]], 'div-gpt-ad-1419899077364-0').addService(googletag.pubads());
+        googletag.pubads().enableSingleRequest();
+        googletag.enableServices();
+        googletag.pubads().collapseEmptyDivs();
+    });
+    </script>
+</head>
+<body><script type="text/javascript">
+//<![CDATA[
+try{(function(a){var b="http://",c="explosm.net",d="/cdn-cgi/cl/",e="img.gif",f=new a;f.src=[b,c,d,e].join("")})(Image)}catch(e){}
+//]]>
+</script>
+<div class="off-canvas-wrap" data-offcanvas>
+<div class="inner-wrap">
+<div id="superheader-bar">
+<div class="row">
+<div class="small-6 medium-3 large-2 columns">
+<a href="/"><img id="explosm-logo" src="/img/logo.png" title="Explosm"/></a>
+<div class="row">
+<div class="small-12 columns">
+<ul id="superheader-social-icons" class="inline-list">
+<li><a href="https://www.facebook.com/explosm"><i class="fa fa-facebook-square"></i></a></li>
+<li><a href="https://plus.google.com/+ExplosmEntertainment"><i class="fa fa-google-plus-square"></i></a></li>
+<li><a href="https://twitter.com/Explosm"><i class="fa fa-twitter-square"></i></a></li>
+<li><a href="http://www.youtube.com/user/ExplosmEntertainment"><i class="fa fa-youtube-square"></i></a></li>
+<li><a href="http://instagram.com/explosmofficial"><i class="fa fa-instagram"></i></a></li>
+<li><a href="http://feeds.feedburner.com/Explosm"><i class="fa fa-rss"></i></a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="large-10 columns hide-for-medium-down">
+<div class="row">
+<div class="small-12 columns text-right">
+<a href="https://explosm.net/user/register">Register</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="https://explosm.net/login" data-reveal-id="sign-in-modal">Sign In</a>
+</div>
+</div>
+<div class="row">
+<nav id="site-nav" class="medium-12 large-12 columns">
+<ul class="inline-list right">
+<li><a href="/comics/archive">Comics</a></li>
+<li><a href="/shorts/">Shorts</a></li>
+<li><a href="/show/">Show</a></li>
+<li><a href="/news/">News</a></li>
+<li><a href="http://store.explosm.net/">Store</a></li>
+<li><a href="/user/register">Season Pass</a></li>
+<li><a href="/rcg">Comic Generator</a></li>
+</ul>
+</nav>
+</div>
+</div>
+<nav class="small-6 medium-9 columns hide-for-large-up">
+<div class="row">
+<div class="small-12 columns text-right">
+<a href="https://explosm.net/user/register">Register</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="https://explosm.net/login" data-reveal-id="sign-in-modal">Sign In</a>
+</div>
+</div>
+<div class="row">
+<div class="large-12 columns">
+<ul id="header-nav-icons" class="inline-list right">
+<li>
+<span class="gamma"><a class="right-off-canvas-toggle" href="#"><i class="fa fa-bars"></i></a></span>
+</li>
+</ul>
+</div>
+</div>
+</nav>
+</div>
+</div>
+<div class="leaderboard-container">
+<div class="leaderboard-ad">
+<div id='div-gpt-ad-1419898864153-0' class="hide-for-small-down">
+<script type='text/javascript'>
+                googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419898864153-0'); });
+                </script>
+</div>
+<div id='div-gpt-ad-1419899139462-0' style='width:320px; height:50px;'>
+<script type='text/javascript'>
+            googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899139462-0'); });
+            </script>
+</div>
+</div>
+</div>
+<div class="clearfix">
+<div class="left ad-sidebar hide-for-medium-down">
+<div id='div-gpt-ad-1419898930001-0'>
+<script type='text/javascript'>
+        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419898930001-0'); });
+        </script>
+</div>
+</div>
+<div id="featured-content-ads-present">
+<div class="row">
+<div class="medium-12 large-10 medium-centered large-centered columns">
+<div class="nav-buttons-top">
+<div class="row">
+<div class="small-12 medium-8 large-6 columns end">
+<ul class="small-block-grid-5">
+<li><a href="/comics/15"><img src="/img/nav-button_first@2x.png"/></a></li>
+<li><a href="/comics/3831/" class="previous-comic"><img src="/img/nav-button_previous@2x.png"/></a></li>
+<li><a href="/comics/random/" class="random-comic-link"><img src="/img/nav-button_random@2x.png"/></a></li>
+<li><a href="#" class="next-comic"><img src="/img/nav-button_next@2x.png"/></a></li>
+<li><a href="/comics/latest/"><img src="/img/nav-button_newest@2x.png"/></a></li>
+</ul>
+</div>
+</div>
+</div>
+<div id="comic-container">
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<img id="main-comic" src="//files.explosm.net/comics/Dave/moneyhappiness.png"/>
+</div>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-6 large-6 columns">
+<div class="row collapse">
+<div class="small-2 medium-2 large-2 columns">
+<img src="//files.explosm.net/avatars/207.jpg"/>
+</div>
+<div class="meta-data">
+<div class="small-8 medium-9 large-8 columns">
+<h3 class="zeta small-bottom-margin past-week-comic-title"><a href="/comics/3832">2015.02.10</a></h3>
+<small class="author-credit-name">by Dave McElfatrick</small>
+<ul class="inline-list interact-share-list">
+<li><small><a href="/comics/3832#comments"><i class="fa fa-comment"></i></a>&nbsp;<span class="comment-count">9</a></small></li>
+<li><small><a href="#" class="favoritable" data-slug="comic-3832" data-type="comic" data-id="3832"><i class="fa fa-star"></i></a>&nbsp;<span class="count">18</span></a></small></li>
+</ul>
+</div>
+</div>
+</div>
+</div>
+<div class="small-12 medium-6 large-6 columns">
+<ul class="custom-comic-social-button-group">
+<li><a href="https://www.facebook.com/dialog/share?app_id=808913609170367&amp;display=popup&amp;href=http%3A%2F%2Fexplosm.net%2Fcomics%2F3832%2F&amp;redirect_uri=http%3A%2F%2Fexplosm.net%2Fcomics%2F3832%2F" class="custom-facebook-button"><i class="fa fa-facebook"></i></a></li>
+<li><a href="https://plus.google.com/share?url=http%3A%2F%2Fexplosm.net%2Fcomics%2F3832%2F" class="custom-google-plus-button"><i class="fa fa-google-plus"></i></a></li>
+<li><a href="https://twitter.com/home?status=Check%20out%20this%20@explosm%20comic!%20http%3A%2F%2Fexplosm.net%2Fcomics%2F3832%2F" class="custom-twitter-button"><i class="fa fa-twitter"></i></a></li>
+</ul>
+</div>
+</div>
+<div id="comic-interact-button-row" class="row">
+<div class="small-12 medium-6 large-6 columns">
+<a href="#comments" class="custom-secondary-button"><i class="fa fa-comment"></i>&nbsp;&nbsp;Add comment</a>
+</div>
+<div class="small-12 medium-6 large-6 columns">
+<a href="#" class="custom-secondary-button favoritable" data-slug="comic-3832" data-type="comic" data-id="3832"><i class="fa fa-star"></i>&nbsp;&nbsp;Favorite This</a>
+</div>
+</div>
+<div class="nav-buttons-bottom">
+<div class="row">
+<div class="small-12 medium-8 large-6 columns end">
+<ul class="small-block-grid-5">
+<li><a href="/comics/15"><img src="/img/nav-button_first@2x.png"/></a></li>
+<li><a href="/comics/3831/" class="previous-comic"><img src="/img/nav-button_previous@2x.png"/></a></li>
+<li><a href="/comics/random/" class="random-comic-link"><img src="/img/nav-button_random@2x.png"/></a></li>
+<li><a href="#" class="next-comic"><img src="/img/nav-button_next@2x.png"/></a></li>
+<li><a href="/comics/latest/"><img src="/img/nav-button_newest@2x.png"/></a></li>
+</ul>
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="right ad-sidebar hide-for-medium-down">
+<div id='div-gpt-ad-1419898959126-0'>
+<script type='text/javascript'>
+        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419898959126-0'); });
+        </script>
+</div>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<hr/>
+</div>
+</div>
+<div>
+<div class="row">
+<div class="large-8 columns">
+<div id="more-from-explosm-container" class="row">
+<div class="large-12 columns">
+<h2 class="gamma">More from Explosm</h2>
+</div>
+<div id="more-from-explosm">
+<p>Loading...</p>
+</div>
+<hr/>
+</div>
+<a id="comments">&nbsp;</a>
+<div id="global-comments-container">
+<p><a href="https://explosm.net/login">Sign in</a> to post a comment</p>
+<div id="comments-container">
+<p>Loading...</p>
+</div>
+</div>
+</div>
+<div class="small-12 medium-12 large-4 columns">
+<div class="row">
+<div class="small-12 columns">
+<h2 class="gamma">Advertisement</h2>
+</div>
+<div class="small-12 medium-4 large-12 columns sidebar-content-block">
+<div id='div-gpt-ad-1419899001581-0'>
+<script type='text/javascript'>
+                    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899001581-0'); });
+                    </script>
+</div>
+</div>
+<div class="small-12 medium-4 large-12 columns sidebar-content-block">
+<div id='div-gpt-ad-1419899033179-0'>
+<script type='text/javascript'>
+                    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899033179-0'); });
+                    </script>
+</div>
+</div>
+<div class="small-12 medium-4 large-12 columns sidebar-content-block">
+<div id='div-gpt-ad-1419899077364-0'>
+<script type='text/javascript'>
+                    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899077364-0'); });
+                    </script>
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div id="explosmore-callout-banner">
+<div class="row">
+<div class="small-12 medium-8 large-9 columns small-only-text center">
+<h4 class="body-font">Did you know by creating an account you can favorite comics and shorts, automatically bookmark the last one you saw, and more? <a href="https://explosm.net/user/register">Learn more about it here!</a></h4>
+</div>
+<div class="small-12 medium-4 large-3 columns">
+<a href="#" class="custom-primary-button" data-reveal-id="sign-in-modal">Sign up!</a>
+</div>
+</div>
+</div>
+<div class="footer-leaderboard-container">
+<div class="leaderboard-ad">
+<div id='div-gpt-ad-1419898892022-0' class="hide-for-small-down">
+<script type='text/javascript'>
+          googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419898892022-0'); });
+          </script>
+</div>
+<div id='div-gpt-ad-1419899188290-0' style='width:320px; height:50px;'>
+<script type='text/javascript'>
+          googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899188290-0'); });
+          </script>
+</div>
+</div>
+</div>
+<div id="footer">
+<div class="row">
+<div class="small-12 small-12 medium-4 large-3 columns">
+<h5>Explore Stuff</h5>
+<ul class="no-bullet">
+<li><a href="/">Home</a></li>
+<li><a href="/comics/archive">Comics</a></li>
+<li><a href="/shorts/">Shorts</a></li>
+<li><a href="/show/">Show</a></li>
+<li><a href="/news/">News</a></li>
+<li><a href="http://store.explosm.net/">Store</a></li>
+<li><a href="/user/register">Season Pass</a></li>
+<li><a href="/rcg">Comic Generator</a></li>
+</ul>
+</div>
+<div class="small-12 medium-4 large-3 columns">
+<h5>Hot Stuff</h5>
+<ul class="no-bullet">
+<li><a href="/comics/3832">Comic for 2015.02.10</a></li>
+<li><a href="/comics/3831">Comic for 2015.02.09</a></li>
+<li><a href="/comics/3830">Comic for 2015.02.08</a></li>
+<li><a href="/comics/3829">Comic for 2015.02.07</a></li>
+<li><a href="/comics/3828">Comic for 2015.02.06</a></li>
+<li><a href="/comics/3827">Comic for 2015.02.05</a></li>
+<li><a href="/comics/3826">Comic for 2015.02.04</a></li>
+<li><a href="/comics/3825">Comic for 2015.02.03</a></li>
+</ul>
+</div>
+<div class="small-12 medium-4 large-3 columns">
+<h5>Legal Stuff</h5>
+<ul class="no-bullet">
+<li><a href="/contact/">Advertising</a></li>
+<li><a href="/privacy/">Privacy Policy</a></li>
+<li><a href="/contact/">Contact Us</a></li>
+</ul>
+</div>
+<div class="small-12 medium-12 large-3 columns">
+<h5>Connect with us</h5>
+<ul id="footer-social-icons" class="inline-list">
+<li><a href="https://www.facebook.com/explosm"><i class="fa fa-facebook-square"></i></a></li>
+<li><a href="https://plus.google.com/+ExplosmEntertainment"><i class="fa fa-google-plus-square"></i></a></li>
+<li><a href="https://twitter.com/Explosm"><i class="fa fa-twitter-square"></i></a></li>
+<li><a href="http://www.youtube.com/user/ExplosmEntertainment"><i class="fa fa-youtube-square"></i></a></li>
+<li><a href="http://instagram.com/explosmofficial"><i class="fa fa-instagram"></i></a></li>
+<li><a href="http://feeds.feedburner.com/Explosm"><i class="fa fa-rss"></i></a></li>
+</ul>
+<a href="https://itunes.apple.com/us/app/cyanide-and-happiness/id368088267?mt=8&uo=4" target="itunes_store" class="show-for-medium-down custom-download-app-button">Download the app!</a>
+</div>
+</div>
+</div>
+<div id="legal-footer">
+<div class="row">
+<div class="small-12 medium-12 large-12 columns"><small>All content is Copyright &copy; 2000–2015 of Explosm, LLC.</small></div>
+</div>
+</div>
+<aside class="right-off-canvas-menu">
+<ul class="off-canvas-list">
+<li><label>Explosm</label></li>
+<li><a href="/">Home</a></li>
+<li><a href="/comics/archive">Comics</a></li>
+<li><a href="/shorts/">Shorts</a></li>
+<li><a href="/show/">Show</a></li>
+<li><a href="/news/">News</a></li>
+<li><a href="http://store.explosm.net/">Store</a></li>
+<li><a href="/user/register">Season Pass</a></li>
+<li><a href="/rcg">Comic Generator</a></li>
+</ul>
+</aside>
+<a class="exit-off-canvas"></a>
+</div>
+</div>
+<div id="sign-in-modal" class="reveal-modal small" data-reveal>
+<div class="row">
+<div class="row">
+<div class="small-9 medium-9 large-9 columns">
+<h4>Log in or Register</h4>
+</div>
+<div class="small-3 medium-3 large-3 columns text-right">
+<span><a class="close-reveal-modal"><i class="fa fa-times close-icon"></i></a></span>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<hr/>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns"><a href="/auth/facebook?_csrf_token=661e848797f613fae942d3f497eeb3f1109c79b8" class="custom-facebook-button"><i class="fa fa-facebook">&nbsp;&nbsp;</i>Sign in with Facebook</a></div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<hr/>
+</div>
+</div>
+<form method="POST" action="https://explosm.net/profile/login_check">
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<label>Username or email address</label>
+<input type="text" name="_username" value=""/>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<label>Password</label>
+<input type="password" name="_password" value=""/>
+</div>
+</div>
+<div class="row">
+<div class="medium-12 large-12 large-centered columns">
+<input id="remember_me" type="checkbox" name="_remember_me" value="1"><label for="remember_me">Remember me</label>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<input type="submit" class="custom-primary-button" value="Log in">
+<small><a href="/profile/forgot_password">Forgot your password?</a></small>
+</div>
+</div>
+</form>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+<hr/>
+</div>
+</div>
+<div class="row">
+<div class="small-12 medium-12 large-12 columns">
+Don't have an account? <a href="/user/register">Join the cool kids here!</a>
+</div>
+</div>
+</div>
+</div>
+<div id="sticky-mobile-ad" class="show-for-small-only">
+<div id='div-gpt-ad-1419899218145-0' style='width:320px; height:50px;'>
+<script type='text/javascript'>
+      googletag.cmd.push(function() { googletag.display('div-gpt-ad-1419899218145-0'); });
+      </script>
+</div>
+</div>
+<script src="/js/bower_components/jquery/dist/jquery.min.js"></script>
+<script src="/js/bower_components/foundation/js/foundation.min.js"></script>
+<script src="/js/waypoints.min.js"></script>
+<script src="/js/jstorage.js"></script>
+<script src="/js/app.js"></script>
+<script type="text/javascript">
+    $(function(){
+        app.init(false);
+            app.favorites();
+    app.moreFromExplosm();
+    app.loadComments('comic-3832');
+        $(document).keydown(function(event){
+        var tag = event.target.tagName.toLowerCase();
+        if (tag != 'input' && tag != 'textarea')
+        {
+            if (event.keyCode == 37)
+                $("a.previous-comic")[0].click();
+            if (event.keyCode == 39)
+                $("a.next-comic")[0].click();
+            if (event.keyCode == 82)
+                $("a.random-comic-link")[0].click();
+        }
+    });
+    });
+    </script>
+<script>
+    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+    ga('create', 'UA-43014788-1', 'explosm.net'); // Hive
+    ga('create', 'UA-52978627-1', 'auto', {'name': 'explosm'});
+    ga('send', 'pageview');
+    ga('explosm.send', 'pageview');
+    </script>
+<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-4.newrelic.com","licenseKey":"2ac27bc758","applicationID":"5003893","transactionName":"YFZaNhFSCkZXUBFbX1kcexcQRwtYGUUMV0doUFcPClA=","queueTime":0,"applicationTime":42,"atts":"TBFZQFlIGUg=","errorBeacon":"bam.nr-data.net","agent":"js-agent.newrelic.com\/nr-515.min.js"}</script></body>
+</html>