aboutsummaryrefslogtreecommitdiff
path: root/make-tweet-url.js
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-11-06 18:24:26 -0800
committerFuwn <[email protected]>2020-11-06 18:24:26 -0800
commit9cdce4254700691301608c6f1d3081950023cc4f (patch)
tree9d24529acc19b354f80cb2d610aa1e7686f4d530 /make-tweet-url.js
downloadblog-9cdce4254700691301608c6f1d3081950023cc4f.tar.xz
blog-9cdce4254700691301608c6f1d3081950023cc4f.zip
repo: initial :star:
Diffstat (limited to 'make-tweet-url.js')
-rw-r--r--make-tweet-url.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/make-tweet-url.js b/make-tweet-url.js
new file mode 100644
index 0000000..b440dcf
--- /dev/null
+++ b/make-tweet-url.js
@@ -0,0 +1,11 @@
+function makeTweetUrl(article) {
+ const title = article.attributes.title;
+ const route = article.attributes.route;
+
+ const baseUrl = "https://twitter.com/intent/tweet";
+ const text = "“" + title + "” by @xFuwn – http://blog.fuwn.me" + route;
+
+ return baseUrl + "?text=" + encodeURIComponent(text);
+}
+
+module.exports = makeTweetUrl;