diff --git a/liberals/libnowplaying.js b/liberals/libnowplaying.js index 0bfb6a2..3876e18 100644 --- a/liberals/libnowplaying.js +++ b/liberals/libnowplaying.js @@ -27,7 +27,7 @@ async function queryLastfm() { "artUrl": response.recenttracks.track[0].image[3]["#text"], "link": response.recenttracks.track[0].url }, - "html": `Album Art

I'm listening to

${response.recenttracks.track[0].name} by ${response.recenttracks.track[0].artist["#text"]}

from ${response.recenttracks.track[0].album["#text"]}

View on Last.fm
` + "html": `Album Art
I'm listening to ${response.recenttracks.track[0].name} by ${response.recenttracks.track[0].artist["#text"]} from ${response.recenttracks.track[0].album["#text"]} View on Last.fm
` } } } @@ -60,7 +60,7 @@ async function queryJellyfin() { "artUrl": `${globalConfig.nowplaying.jellyfin.hostPublic}/Items/${response[x].NowPlayingItem.Id}/Images/Primary`, "link": `https://www.last.fm/music/${response[x].NowPlayingItem.Artists[0].replaceAll(" ","+")}/_/${response[x].NowPlayingItem.Name.replaceAll(" ","+")}` }, - "html": `Album Art

I'm listening to

${response[x].NowPlayingItem.Name} by ${response[x].NowPlayingItem.Artists[0]}

from ${response[x].NowPlayingItem.Album ?? `${response[x].NowPlayingItem.Name} (Single)`}

View on Last.fm
` + "html": `Album Art
I'm listening to ${response[x].NowPlayingItem.Name} by ${response[x].NowPlayingItem.Artists[0]} from ${response[x].NowPlayingItem.Album ?? `${response[x].NowPlayingItem.Name} (Single)`} View on Last.fm
` } } diff --git a/routes/frontpage.js b/routes/frontpage.js index a91402e..91fc172 100644 --- a/routes/frontpage.js +++ b/routes/frontpage.js @@ -11,7 +11,7 @@ app.get("/", (rreq, rres) => { if (Date.now() < timeSinceLastQuery+10000) { rres.send(cachedResult) } else { - let indexFile = fs.readFileSync(process.cwd()+"/website/templates/indextemplate.html","utf-8") + let indexFile = fs.readFileSync(process.cwd()+"/website/templates/newindextemplate.html","utf-8") cachedResult = indexFile.replace("",parseFiles()).replace("",`API Version ${globalVersion}`) rres.send(cachedResult) } @@ -22,7 +22,7 @@ app.get("/static/*", (rreq,rres) => { }) app.get("/favicon.ico", (rreq,rres) => { - rres.sendFile(process.cwd()+"/website/static/bs.ico") + rres.sendFile(process.cwd()+"/website/static/snow-leopard.ico") }) app.get("/posts/*", (rreq,rres) => { diff --git a/website/posts/20240409-API-Documentation.html b/website/posts/20240409-API-Documentation.html index c030ee6..fd7f099 100644 --- a/website/posts/20240409-API-Documentation.html +++ b/website/posts/20240409-API-Documentation.html @@ -2,7 +2,7 @@ - + @@ -16,27 +16,47 @@ Return to enstrayed.com

API Documentation

-

This page was last updated 2024-08-20.

+

This page was last updated 2025-04-26.

Source Code & Issue Tracker: github.com/enstrayed/enstrayedapi


+
+

Important Note

+
+ +

Multiple API endpoints are being rewritten/added, especially relating to authentication & authorization, as part of a database change to Postgres. These changes are being made in the new-db branch.

+

/api/nowplaying

nowplaying.js - GET +
+ GET +

Returns whatever I'm listening to via the Last.fm API in JSON. If ?format=html is used in the URL it will return the same but in HTML. If nothing is playing the JSON response will just have "playing": false.

+
+

/api/nowplayingbeta

+ nowplaying.js +
+ GET +
+
+ +

Beta verison of the /nowplaying endpoint. This version will change frequently but presently queries my Jellyfin for what I'm listening to and will return that as JSON. If ?format=html is appended to the URL it will return the same but in HTML. Each line in the HTML response has a class nowPlayingLine[1-4] that can be used to style the text using CSS. See libnowplaying.js:63 for the format of the result.

+

/api/etyd/*

etyd.js - GET - POST - DELETE +
+ GET + POST + DELETE +

Retrieves, creates or deletes entries for the etyd.cc URL shortener. Replace * in the URL for the target of the request.

@@ -53,7 +73,9 @@

/api/sendemail

mailjet.js - POST +
+ POST +

Sends an email to the specified recipient, intended for application & automation use.

@@ -72,7 +94,7 @@

/api/ip

ip.js - GET +
GET

Returns the IP, country and Cloudflare ray of the request in JSON.

@@ -80,7 +102,7 @@

/api/headers

ip.js - GET +
GET

Returns all request headers in JSON.

diff --git a/website/static/bs.ico b/website/static/bs.ico deleted file mode 100644 index bfb61b8..0000000 Binary files a/website/static/bs.ico and /dev/null differ diff --git a/website/static/icons/external.svg b/website/static/icons/external.svg new file mode 100644 index 0000000..9f0431b --- /dev/null +++ b/website/static/icons/external.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/website/static/icons/github.svg b/website/static/icons/github.svg new file mode 100644 index 0000000..e1632c7 --- /dev/null +++ b/website/static/icons/github.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/website/static/icons/link.svg b/website/static/icons/link.svg new file mode 100644 index 0000000..df65a89 --- /dev/null +++ b/website/static/icons/link.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/website/static/icons/post.svg b/website/static/icons/post.svg new file mode 100644 index 0000000..4ab0ab5 --- /dev/null +++ b/website/static/icons/post.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/website/static/icons/twitter.svg b/website/static/icons/twitter.svg new file mode 100644 index 0000000..7d37572 --- /dev/null +++ b/website/static/icons/twitter.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/website/static/newindex.css b/website/static/newindex.css new file mode 100644 index 0000000..26acfa6 --- /dev/null +++ b/website/static/newindex.css @@ -0,0 +1,80 @@ +body { + margin: 2em 0 0 0; + font-family: 'Segoe UI Variable', sans-serif; + + background-color: #282828; + color: #F1F1F1; + + display: grid; + place-items: center; + + +} + +.mainContent { + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 2.5em; + + padding: 2em; + background-color: #202020; + box-shadow: 0 0 1em 0 #202020; +} + +.linkColumn { + display: flex; + flex-direction: column; + gap: 0.5em; +} + +#nowplaying { + display: flex; + flex-direction: row; + gap: 1em; + flex-wrap: wrap; +} + +#nowplaying > img { + height: 10em; +} + +#nowplaying > div { + display: flex; + flex-direction: column; + justify-content: center; + gap: 0.2em; + max-width: 14em; +} + +#nowplaying .nowPlayingLine2 { + font-size: 1.4em; +} + +.apiVersion { + margin: 0.8em 0 0.8em; +} + +.marginBottom1em { + margin: 0 0 1em; +} + +.blogPostsList > ul { + list-style-image: url('/static/icons/post.svg'); + list-style-position: inside; + padding: 0; + margin: 0; + gap: 0.5em; +} + +a, a:link { + color: #FF5A36; +} + +a:hover { + color: #ff8266; +} + +a > img { + margin-right: 0.2em; +} \ No newline at end of file diff --git a/website/static/newposts.css b/website/static/newposts.css new file mode 100644 index 0000000..b7f53c9 --- /dev/null +++ b/website/static/newposts.css @@ -0,0 +1,43 @@ +html { + display: grid; + place-items: center; + background-color: #282828; +} + +body { + margin: 2em 0 0 0; + font-family: 'Segoe UI Variable', sans-serif; + + background-color: #202020; + color: #F1F1F1; + + max-width: 80ch; + padding: 2em; + box-shadow: 0 0 1em 0 #202020; +} + +a, a:link { + color: #FF5A36; +} + +a:hover { + color: #ff8266; +} + +.inlineheader { + display: flex; + align-items: center; + margin-top: 2rem; + gap: 1em; + flex-wrap: wrap; +} + +.inlineheader h2 { + margin: 0; +} + +.inlineheader > div > span { + padding: 0.2rem; + color: white; + background-color: #f06445; +} \ No newline at end of file diff --git a/website/static/orange-globe.svg b/website/static/orange-globe.svg new file mode 100644 index 0000000..67bdf05 --- /dev/null +++ b/website/static/orange-globe.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/website/static/posts.css b/website/static/posts.css index 3df6078..656b127 100644 --- a/website/static/posts.css +++ b/website/static/posts.css @@ -50,9 +50,10 @@ h2 { align-items: center; margin-top: 2rem; gap: 1em; + flex-wrap: wrap; } -.inlineheader > span { +.inlineheader > div > span { padding: 0.2rem; color: white; background-color: #f06445; diff --git a/website/static/snow-leopard.ico b/website/static/snow-leopard.ico new file mode 100644 index 0000000..2320ba5 Binary files /dev/null and b/website/static/snow-leopard.ico differ diff --git a/website/static/snow-leopard.png b/website/static/snow-leopard.png new file mode 100644 index 0000000..0795188 Binary files /dev/null and b/website/static/snow-leopard.png differ diff --git a/website/static/snow-leopard.svg b/website/static/snow-leopard.svg new file mode 100644 index 0000000..344d548 --- /dev/null +++ b/website/static/snow-leopard.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/website/templates/markdownposttemplate.html b/website/templates/markdownposttemplate.html index cbcf96e..a34529f 100644 --- a/website/templates/markdownposttemplate.html +++ b/website/templates/markdownposttemplate.html @@ -2,16 +2,18 @@ - + - + <!--SSR_REPLACE_TITLE--> + + diff --git a/website/templates/newindextemplate.html b/website/templates/newindextemplate.html new file mode 100644 index 0000000..5ca4add --- /dev/null +++ b/website/templates/newindextemplate.html @@ -0,0 +1,74 @@ + + + + + + Enstrayed.com + + + + + + + + + + + + + + +
+
+ Globe Icon +

Welcome to Enstrayed.com

+
+
+ I received an Email from @enstrayed.com
+ Click here for information about EOES +
+
+ I need help with an Enstrayed.com web service
+ Click here to visit the Helpdesk +
+
+ URL Toolbox +
+
+ API Documentation +
+
+ Downloads +
+
+ +
+
+
+
+ Snow Leopard Icon +

@Enstrayed

+
+ Twitter + GitHub +
+
+
+

Notes

+
    + +
+
+
+
+ + \ No newline at end of file