Add "Post a new script" link to greatest.deepsurf.us and sleazyfork.org nav menu

Add "Post a new script" link to greatest.deepsurf.us and sleazyfork.org nav menu - 8/28/2022, 10:16:09 PM

  1. // ==UserScript==
  2. // @name Add "Post a new script" link to greatest.deepsurf.us and sleazyfork.org nav menu
  3. // @namespace Violentmonkey Scripts
  4. // @match https://sleazyfork.org/*
  5. // @match https://greatest.deepsurf.us/*
  6. // @grant none
  7. // @version 1.0
  8. // @author -
  9. // @description Add "Post a new script" link to greatest.deepsurf.us and sleazyfork.org nav menu - 8/28/2022, 10:16:09 PM
  10. // ==/UserScript==
  11.  
  12.  
  13. // I got these by looking at the page title on greatest.deepsurf.us, so if something wasn't translated, it was in English.
  14. link_name_translated = {
  15. "ar": "Post a new script",
  16. "bg": "Публикувай нов скрипт",
  17. "cs": "Post a new script",
  18. "da": "Post a new script",
  19. "de": "Neues Skript veröffentlichen",
  20. "el": "Δημοσίευση νέου κώδικα",
  21. "en": "Post a new script",
  22. "eo": "Post a new script",
  23. "es": "Publicar un nuevo script",
  24. "fi": "Post a new script",
  25. "fr": "Publier un nouveau script",
  26. "fr-CA": "Publier un nouveau script",
  27. "he": "Post a new script",
  28. "hu": "Post a new script",
  29. "id": "Post a new script",
  30. "it": "Pubblica un nuovo script",
  31. "ja": "スクリプトを投稿",
  32. "ko": "새 스크립트 업로드",
  33. "nb": "Post a new script",
  34. "nl": "Nieuw scripts publiceren",
  35. "pl": "Opublikuj nowy skrypt",
  36. "pt-BR": "Postar um novo script",
  37. "ro": "Postează un nou script",
  38. "ru": "Опубликовать новый скрипт",
  39. "sk": "Pridať nový skript",
  40. "sr": "Post a new script",
  41. "sv": "Post a new script",
  42. "th": "Post a new script",
  43. "tr": "Yeni script paylaş",
  44. "uk": "Додати новий скрипт",
  45. "ug": "Post a new script",
  46. "vi": "Post a new script",
  47. "zh-CN": "发布新脚本",
  48. "zh-TW": "發佈新腳本",
  49. };
  50.  
  51. country_code = window.location.pathname.split('/')[1];
  52.  
  53. if (! (country_code in link_name_translated)) {
  54. country_code = "en"; // if you type random crap into the country code in the url, the website defaults to English
  55. }
  56.  
  57. setTimeout(function() {
  58. li = document.createElement("li");
  59. li.className = "scripts-index-link";
  60. a = document.createElement("a");
  61. a.href = "/" + country_code + "/script_versions/new";
  62. a.innerText = link_name_translated[country_code];
  63. li.appendChild(a);
  64. document.querySelector("div#site-nav > nav").prepend(li);
  65. }, 100);