Skip to content

Commit

Permalink
[tvmaze] basic script that will mark ended shows on watchlist page
Browse files Browse the repository at this point in the history
  • Loading branch information
vBm committed Jan 31, 2016
1 parent a47d0a5 commit 5afc2b4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions ended.tvmaze.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ==UserScript==
// @name TVMaze Ended Shows
// @namespace tvmaze
// @description Distinguish ended shows on TVMaze with *
// @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/watchlist*
// @version 0.1
// @date 31/01/2016
// @grant none
// ==/UserScript==

$.ajax({
url: '//' + $(location).attr('hostname') + '/showstatus',
cache: false,
}).done(function(data) {
var showNames = [];
if ($(data).find('[data-title^=Status]').size() !== 0 ) {
$(data).find('[data-title^=Status]').each(function() {
if ($(this).text() === 'Ended') {
showNames.push($(this).parent().find('[data-title^=Show]').text());
}
});
$('H2').each(function() {
if ($.inArray($(this).text(), showNames) > -1 ) {
$(this).html('* '+ $(this).html());
}
});
}
});

0 comments on commit 5afc2b4

Please sign in to comment.