mirror of
https://git.kahtlane.info/siinus/frogDolphin.git
synced 2023-07-05 08:00:41 +03:00
Initial commit suicide
This commit is contained in:
parent
4b54bd989d
commit
70ddb2b016
@ -1,2 +1,5 @@
|
|||||||
# frogDolphin
|
# frogDolphin
|
||||||
|
Sul on vaja posix shelli ja awk'i. Palju õnne!
|
||||||
|
|
||||||
|
|
||||||
|
Lisaks on siin algne tampermonkey skript.
|
||||||
|
25
freeDelfi.js
Normal file
25
freeDelfi.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// @name FreeDelfi
|
||||||
|
// @namespace http://tampermonkey.net/
|
||||||
|
// @version 0.1
|
||||||
|
// @description asdasd
|
||||||
|
// @author asdasd
|
||||||
|
// @match https://*.delfi.ee/*
|
||||||
|
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
|
||||||
|
// @grant none
|
||||||
|
// ==/UserScript==
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
const secretCode = () => {
|
||||||
|
const now = new Date()
|
||||||
|
const yyyymmdd = +now.toISOString().slice(0, 10).replace(/-/g, '')
|
||||||
|
const yyyy = now.getFullYear()
|
||||||
|
return yyyymmdd * yyyy
|
||||||
|
}
|
||||||
|
const modify = () => {
|
||||||
|
console.log("freedelfi");
|
||||||
|
history.replaceState(null, null, "?preview=" + secretCode());
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
return window.location.href.split('?')[1] && window.location.href.split('?')[1].includes('preview') ? undefined : modify();
|
||||||
|
})();
|
||||||
|
|
14
freeDelfi.sh
Normal file
14
freeDelfi.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
INPUT_URL=$(echo "$1" | awk 'match($0, /(https:\/\/[a-z]+\.delfi\.ee\/artikkel\/[0-9]+)/) {print substr($0, RSTART, RLENGTH)}')
|
||||||
|
|
||||||
|
if [ "$INPUT_URL" = "" ]; then
|
||||||
|
echo "Kahtlane url, nigga"
|
||||||
|
exit;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
DATE_NOW=$(date -u +%Y%m%d)
|
||||||
|
YEAR_NOW=$(date -u +%Y)
|
||||||
|
SECRET_CODE=$((DATE_NOW * YEAR_NOW))
|
||||||
|
|
||||||
|
echo "$INPUT_URL?preview=$SECRET_CODE"
|
Loading…
Reference in New Issue
Block a user