From 7656c1f90cd8ef2bc6f5bd3d26a583128dd749c7 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 7 Jul 2021 15:46:57 +0100 Subject: Add email_bookmarks script --- includes/functions.php | 2 +- scripts/email_bookmarks.php | 50 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 scripts/email_bookmarks.php diff --git a/includes/functions.php b/includes/functions.php index b5208e6..0118807 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -8,7 +8,7 @@ function respondAndExit(int $responseCode, string $header, array $headers = []): header($header); } - header('Content-type: text/plain; charset=UTF-8'); + header('Content-Type: text/plain; charset=UTF-8'); exit(); } diff --git a/scripts/email_bookmarks.php b/scripts/email_bookmarks.php new file mode 100644 index 0000000..891ab4d --- /dev/null +++ b/scripts/email_bookmarks.php @@ -0,0 +1,50 @@ +%s', + $site, + urlencode($url), + htmlentities($url) + ); + }, $urls); + + $urls = sprintf('
    %s
', implode('', $urls)); + + return <<< EOF_HTML + + +

Below are today's bookmarks for reading.

+ $urls + + +EOF_HTML; +} -- cgit v1.2.3-13-gbd6f