From 22c69bc1b7086656e553d220bca7ecea94669c3b Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sun, 6 Feb 2022 15:25:51 -0600 Subject: [PATCH] Add fedifeed to readme Signed-off-by: Sam Therapy --- .eslintrc.json | 1 + README.md | 2 ++ package.json | 2 -- src/public/index.html | 30 +++--------------------------- src/public/script.js | 24 ++++++++++++++++++++++++ 5 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 src/public/script.js diff --git a/.eslintrc.json b/.eslintrc.json index a01402e..5a166a4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,6 @@ { "env": { + "browser": true, "es2021": true, "node": true }, diff --git a/README.md b/README.md index 3a98af8..066ee19 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Fedifeed +[![Build Status](https://ci.git.froth.zone/api/badges/Sam/fedifeed/status.svg)](https://ci.git.froth.zone/Sam/fedifeed) + Embed an activitypub feed in your blog et cetera. https://www.fedifeed.com diff --git a/package.json b/package.json index 696be95..b0a4f77 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,6 @@ "got": "^12.0.1", "megalodon": "^4.0.0", "morgan": "^1.10.0", - "request": "^2.88.2", - "request-promise-cache": "^2.0.1", "serve-static": "^1.14.2", "timeago.js": "^4.0.2", "typescript": "^4.5.5" diff --git a/src/public/index.html b/src/public/index.html index cc400bd..35b00d2 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -1,3 +1,4 @@ + @@ -5,13 +6,14 @@ Fedifeed - embeddable ActivityPub feeds +

Fedifeed

-

Embedded ActivityPub feeds for blogs etc.

+

Embedded ActivityPub feeds for blogs, websites, etc.

Fork on Github

@@ -65,32 +67,6 @@
- diff --git a/src/public/script.js b/src/public/script.js new file mode 100644 index 0000000..f3ed569 --- /dev/null +++ b/src/public/script.js @@ -0,0 +1,24 @@ +window.genUrl = function genUrl() { + function val(id) { + return document.getElementById(id).value; + } + + let user = val("usernamein"); + let instance = "https://" + val("urlin"); + + var showBoosts = (!document.getElementById("hideboosts").checked).toString(); + var showReplies = (!document.getElementById("hidereplies").checked).toString(); + var showHeader = document.getElementById("header").checked.toString(); + var portStr = (window.location.port && window.location.port != 80) ? (":" + window.location.port) : ""; + + var iframeUrl = window.location.protocol + "//" + window.location.hostname + portStr + + "/api/v1/feed?user=" + encodeURIComponent(user) + "&instance=" + encodeURIComponent(instance) + "&instance_type=" + "&theme=" + val("theme") + "&size=" + val("size") + + "&header=" + showHeader + "&replies=" + showReplies + "&boosts=" + showBoosts; + + document.getElementById("result").value = ""; + + var iframe = document.getElementById("frame"); + iframe.src = iframeUrl; + iframe.width = val("width"); + iframe.height = val("height"); +}; \ No newline at end of file