Skip to content

Commit

Permalink
FollowShows with addic7ed flavor
Browse files Browse the repository at this point in the history
Adds button below the "mark as watched/watched" one that opens correct
addic7ed page for that specific episode.
  • Loading branch information
vBm committed Oct 18, 2012
1 parent f50e960 commit b20e7ed
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions addic7ed.followshows.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ==UserScript==
// @name FollowShows Subtitles
// @namespace followshows
// @description Link addic7ed subs
// @author vBm <[email protected]>
// @include http://followshows.com/show/*
// @include http://www.followshows.com/show/*
// @version 1
// ==/UserScript==

var showInfo = document.location.href.split('/');
var showInfoName = showInfo[4];
var showInfoDetails = showInfo[6];
var showInfoSeason = showInfoDetails.match(/(\d+)/g)[0].replace(/^0+/, "");
var showInfoEpisode = showInfoDetails.match(/(\d+)/g)[1].replace(/^0+/, "");
var showInfoEpisodeName = document.getElementsByClassName('episode-title')[0].textContent;
var subtitlesUrl = 'http://www.addic7ed.com/serie/'+showInfoName+'/'+showInfoSeason+'/'+showInfoEpisode+'/'+showInfoEpisodeName;

var subsbutton = document.createElement("a");
subsbutton.setAttribute('class', 'btn watch-episode-button addic7ed');
subsbutton.setAttribute('style', 'top:24px');
subsbutton.textContent = 'Addic7ed subs';
subsbutton.addEventListener('click', function() { window.open(subtitlesUrl) });
var showInfoDiv = document.getElementsByClassName('column_2')[0]
showInfoDiv.appendChild(subsbutton);

0 comments on commit b20e7ed

Please sign in to comment.