]> git.r.bdr.sh - rbdr/linkding-linkblog-updater/commitdiff
Make some of the values more generic
authorRuben Beltran del Rio <redacted>
Sun, 21 Jan 2024 13:56:39 +0000 (13:56 +0000)
committerRuben Beltran del Rio <redacted>
Sun, 21 Jan 2024 13:56:39 +0000 (13:56 +0000)
index.js

index f8df008c994c4e35760c6524f1030d8ee690fbef..518cc79b83c44610a609e824d7c7da1d9d48a30a 100644 (file)
--- a/index.js
+++ b/index.js
@@ -10,7 +10,10 @@ const internals = {
   apiToken: process.env.PINBOARD_TOKEN,
   blogUrl: process.env.BLOG_URL,
   archiveUrl: process.env.ARCHIVE_URL,
   apiToken: process.env.PINBOARD_TOKEN,
   blogUrl: process.env.BLOG_URL,
   archiveUrl: process.env.ARCHIVE_URL,
+  blogPublicUrl: process.env.BLOG_PUBLIC_URL,
+  archivePublicUrl: process.env.ARCHIVE_PUBLIC_URL,
   tootToken: process.env.TOOT_TOKEN,
   tootToken: process.env.TOOT_TOKEN,
+  mastodonDomain: process.env.MASTODON_DOMAIN,
 
   date: (new Date()).toISOString().split('T')[0],
 
 
   date: (new Date()).toISOString().split('T')[0],
 
@@ -45,9 +48,9 @@ const internals = {
     const body = new FormData();
     body.set(
       'status',
     const body = new FormData();
     body.set(
       'status',
-      `New post: ${title}\n\nAvailable on:\n\nā™Šļø the gemini archive gemini://gemini.unlimited.pizza/gemlog/\n\n or, the ephemeral blog šŸŒ: https://www.unlimited.pizza/gemlog`
+      `New post: ${title}\n\nAvailable on:\n\nā™Šļø the gemini archive ${internals.archivePublicUrl}\n\n or, the ephemeral blog šŸŒ: ${internals.blogPublicUrl}`
     );
     );
-    return fetch('https://friendship.quest/api/v1/statuses', {
+    return fetch(`https://${internals.mastodonDomain}/api/v1/statuses`, {
       method: 'post',
       headers: {
         Authorization: `Bearer ${internals.tootToken}`,
       method: 'post',
       headers: {
         Authorization: `Bearer ${internals.tootToken}`,