AnimeSeason Watch List

Highlights anime in your last watched list that have unwatched episodes

  1. // ==UserScript==
  2. // @name AnimeSeason Watch List
  3. // @namespace s
  4. // @description Highlights anime in your last watched list that have unwatched episodes
  5. // @include http://www.animeseason.com/*
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. // a function that loads jQuery and calls a callback function when jQuery has finished loading
  11. function addJQuery(callback) {
  12. var script = document.createElement('script');
  13. script.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
  14. script.addEventListener('load', function () {
  15. var script = document.createElement('script');
  16. script.textContent = 'window.jQ=jQuery.noConflict(true);(' + callback.toString() + ')();';
  17. document.body.appendChild(script);
  18. }, false);
  19. document.body.appendChild(script);
  20. }
  21.  
  22. // Search for next episodes
  23. function main() {
  24. // Note, jQ replaces $ to avoid conflicts.
  25. jQ('#header_lw') .next('ul') .children() .each(function () {
  26. var link = jQ(this) .children() .attr('href');
  27. var item = jQ(this) .children();
  28. jQ.ajax({
  29. url: link
  30. }) .done(function (page) {
  31. if (page.indexOf('[NEXT]') > 0) item.css('color', '#cca');
  32. });
  33. });
  34. }
  35.  
  36. // load jQuery and execute the main function
  37. addJQuery(main);