Skip to content

Commit

Permalink
Add TVMaze -> RARBG TV browser button
Browse files Browse the repository at this point in the history
  • Loading branch information
vBm committed Jul 29, 2016
1 parent 4bf2263 commit f107559
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

***Some of scripts I've wrote for personal use but decided to share 'em.***

# TVMaze -> RARBG

[This userscript](rarbg.tvmaze.user.js) has a simple task of adding 'rarbg' button on shows page that will open a new tab which will lead to that show on rarbg.

![RARBG TVmaze](img/tvmaze.rarbg.png "TVMaze -> RARBG bridge")

# TVMaze Episode Counter

[This userscript](counter.tvmaze.user.js) has simple task of showing remaining episodes count to finish all of the shows on the [watchlist](http://www.tvmaze.com/watchlist).
Expand Down
Binary file added img/tvmaze.rarbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions rarbg.tvmaze.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ==UserScript==
// @name TVMaze RARBG
// @namespace tvmaze
// @description add rarbg link to tvmaze show page
// @icon http://tvmazecdn.com/images/favico/favicon.ico
// @author vBm <[email protected]>
// @oujs:author vBm
// @license The MIT License (MIT)
// @supportURL https://github.com/vBm/snippets/issues
// @include http://www.tvmaze.com/shows/*
// @version 0.4
// @date 29/07/2016
// @grant none
// ==/UserScript==

$.getJSON(
`//api.tvmaze.com/shows/${$('script:contains(/stats/)').text().match(/\d+/)[0]}`
).done(function(json) {
$('#main-img').append(
$('<a>').attr({
id: 'watching',
class: 'radius small button secondary rarbg js-needlogin',
target: '_blank',
}).css({
float: 'right',
width: '100%',
marginTop: '3px'
}).text(' RARBG ').click(
function() {
window.open(`https://rarbg.to/tv/${json.externals.imdb}/`);
}
)
);
$('<i class="fa fa-arrow-circle-down"></i>').prependTo('.rarbg');
});

0 comments on commit f107559

Please sign in to comment.