Added reddit redirects

This commit is contained in:
MrLuit 2017-05-10 08:35:42 +02:00
commit b08c3cdb4d
4 changed files with 12 additions and 7 deletions

View file

@ -164,7 +164,7 @@ task :generateurls do
yaml = yaml.split(" -")
url_prefix_file = File.open("./_config.yml", 'r')
url_prefix = url_prefix_file.read
url_prefix = url_prefix.split('url: "')[1].split('"')[0]
url_prefix = url_prefix.split('url: ')[1].split("\n")[0]
url_prefix_file.close
yaml.each_with_index {
|x, index|
@ -172,6 +172,7 @@ task :generateurls do
title = x.split("title: '")[1].split("'\n")[0]
url = "url: '"
url << url_prefix
url << '/'
url << title.prettyurl
url << "/'"
oldurl = "url: '"

View file

@ -16,7 +16,7 @@
title: Trump Tracker
email: viren.mohindra+trump@gmail.com
description: Track Donald J Trump's Electoral Promises with Trump Tracker.
url: "https://trumptracker.github.io/"
url: https://trumptracker.github.io
twitter_username: VirenMohindra
github_username: TrumpTracker

View file

@ -55,6 +55,13 @@ function loopComments(reddit, reply = false) {
}
}
if(document.location.href.indexOf("?reddit") !== -1) {
document.location = 'https://redd.it/' + redditid;
}
document.getElementsByClassName("loader")[0].style.display = 'block';
document.getElementsByClassName("noscript")[0].outerHTML='';
window.addEventListener('load', function() {
reddit.comments(redditid, "trumptracker").limit(20).sort("hot").fetch(function(res) {
res.shift();
@ -64,7 +71,4 @@ window.addEventListener('load', function() {
$("#reddit_comments").append("<h4>There are no comments yet</h4>");
}
});
});
document.getElementsByClassName("loader")[0].style.display = 'block';
document.getElementsByClassName("noscript")[0].outerHTML='';
});

View file

@ -13,7 +13,7 @@ permalink: /:basename/
<div class="col-md-12">
<h3>Category: First 100 Days</h3>
<h3>Status: <span style='color: #5cb85c;'>Achieved</span></h3>
<b>While Trump still received the money, he donated everthing to the National Park Service, which is arguably even better than refusing.</b><br><br>
<b>While Trump still received the money, he donated everything to the National Park Service, which is arguably even better than refusing the money.</b><br><br>
<p></p>
</div>
<div class="col-md-12">