Skip to content

Instantly share code, notes, and snippets.

@xingoxu
Created May 4, 2019 22:45
Show Gist options
  • Save xingoxu/c5f3b476fc1ddc1f07a10c0b525c6a35 to your computer and use it in GitHub Desktop.
Save xingoxu/c5f3b476fc1ddc1f07a10c0b525c6a35 to your computer and use it in GitHub Desktop.
See Privatter post with password
// ==UserScript==
// @name Privatter Nopassword
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://privatter.net/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let passwordInput = $('input[type=password]');
if (!passwordInput[0]) {
return;
}
const getPrivatterCookie = (url) => {
let privatterId = url.match(/privatter\.net\/(\w)\/(\d+)/i);
let privatterType;
if (privatterId == null || privatterId.length < 3) {
return [];
} else {
let date = new Date();
date.setFullYear(date.getFullYear() + 1);
privatterType = privatterId[1];
privatterId = privatterId[2];
return [`${privatterType}${privatterId}=1; path=/${privatterType}; expires=${date.toGMTString()}`, `pass_${privatterType}${privatterId}=1; path=/${privatterType}; expires=${date.toGMTString()}`];
}
}
let button = document.createElement('button');
button.className = 'btn btn-primary';
button.innerText = '見たい';
button.addEventListener('click', (e) => {
for (let i of getPrivatterCookie(location.href)) {
document.cookie = i;
}
console.log(getPrivatterCookie(location.href));
e.stopPropagation();
e.preventDefault()
setTimeout(() => {
location.reload()
}, 0);
}, false);
passwordInput.parent().append(button);
})();
@ArsxNova
Copy link

Aun funciona ? Alguno conoce una herramienta para "poipiku" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment