diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-09 20:47:01 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-09 20:47:01 +0000 |
| commit | 80d9e02ea47bfb783cc2033162ae9231551e5654 (patch) | |
| tree | 46ff8224aba31db47a5c3094a0609a297cf33ec3 /make_bookmarklet | |
| parent | b15a095c0e5f980b63c1b229b0671227bfc64316 (diff) | |
Delete files that are no longer neededrewrite
Diffstat (limited to 'make_bookmarklet')
| -rw-r--r-- | make_bookmarklet/index.php | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/make_bookmarklet/index.php b/make_bookmarklet/index.php deleted file mode 100644 index 67dea14..0000000 --- a/make_bookmarklet/index.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -error_reporting(E_ALL); - -$config = require_once(__DIR__.'/../config.php'); - -$booklet = <<< EOF_JS -javascript: (() => { - async function bookmarkPage(page) { - const response = await fetch('{$config['site']}/add/', { - method: 'POST', - mode: 'cors', - cache: 'no-cache', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Authorization': 'Bearer {$config['bearer_token']}', - }, - redirect: 'follow', - referrerPolicy: 'no-referrer', - body: page - }); - return response; - } - - bookmarkPage(`url=\${encodeURIComponent(window.location.href)}`) - .then(data => { - if (data.status === 201) { - alert('Page bookmarked'); - } else { - alert(`Failed with status \${data.status} \${data.statusText}`); - } - }); -})(); -EOF_JS; - -echo $booklet; |
