Auto-desbloqueio do Koo

Só para se auto-desbloquear no Koo!

  1. // ==UserScript==
  2. // @name Auto-desbloqueio do Koo
  3. // @name:en Self Unblock from Koo
  4. // @namespace https://geovani.dev/
  5. // @version 0.2
  6. // @description Só para se auto-desbloquear no Koo!
  7. // @description:en Just for self unblocking!
  8. // @author Geovani Perez França
  9. // @match https://www.kooapp.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=kooapp.com
  11. // @grant none
  12. // @keywords koo,lock,self,unlock
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. window.addEventListener('load', () => {
  20. addButton('Se desbloquear', selfUnblock)
  21. })
  22.  
  23. function addButton(text, onclick) {
  24. let kooBtn = document.querySelector('a > button')
  25.  
  26. let unblockA = document.createElement('a')
  27. document.body.append(unblockA)
  28. unblockA.innerHTML = `<button class="${kooBtn.classList.toString()}">${text}</button>`
  29. unblockA.onclick = onclick
  30. unblockA.style = "position: absolute; top: 1em; left: 1em; z-index: 999;"
  31. return unblockA
  32. }
  33.  
  34. function getCookie(name) {
  35. var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
  36. if (match) return match[2];
  37. }
  38.  
  39. function selfUnblock(element) {
  40. let id = getCookie("userId");
  41. let token = getCookie("token");
  42.  
  43. fetch('/apiV1/users/unblock/' + id, {
  44. method: 'DELETE',
  45. headers: {token}
  46. })
  47.  
  48. alert("Prontinho, seu koo tá desbloqueado!")
  49. }
  50.  
  51. })();