GitHub Status

Changes the colour of the main Github octocat icon according to status.github.com

  1. // ==UserScript==
  2. // @name GitHub Status
  3. // @icon https://github.com/eXistenZNL/userscripts/raw/master/icons/github.png
  4. // @namespace eXistenZNL
  5. // @description Changes the colour of the main Github octocat icon according to status.github.com
  6. // @include https://*github.com/*
  7. // @version 3.0.1
  8. // @grant none
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. (function($) {
  13. $.get(
  14. 'https://status.github.com/api/status.json',
  15. function(data) {
  16. colors = {
  17. 'good': '#396',
  18. 'minor': '#f29d50',
  19. 'major': '#c30'
  20. };
  21. $logo = $('.header-logo-invertocat .octicon-mark-github');
  22. $logo.css('color', colors[data.status]);
  23. }
  24. );
  25. })(jQuery);