diff --git a/README.md b/README.md index f12daa0..43aa85a 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,28 @@ This software was inspired from Tigase and was motivated by Movim. ## Installation +### Download + Extract the source package to a directory that you have permission to run software. -Execute with one of the followings: +```shell +$ git clone https://git.xmpp-it.net/sch/PubSubToAtom +$ cd PubSubToAtom/ +``` + +### Configure + +Add account credentials to file `configuration.toml`. + +### Start + +Execute PubSubToAtom with one of the following commands: ```shell -$ uvicorn pubsub_to_atom:app --host 127.0.0.1 --port 8000 $ python -m uvicorn pubsub_to_atom:app --reload +$ python -m uvicorn pubsub_to_atom:app --reload --host 127.0.0.1 --port 8000 +$ uvicorn pubsub_to_atom:app --host 127.0.0.1 --port 8000 $ fastapi dev pubsub_to_atom.py ``` @@ -36,22 +50,26 @@ $ fastapi dev pubsub_to_atom.py It is possible to view a complete node and even a single item, which means, that it is possible to save bandwidth and it further means that a considered and carefully earnest use of this software would saves system overhead, which includes CPU, I/O and RAM usage. -### Viewing node items +### Viewing PubSub -|PubSub |Node | -|--- |--- | -|xmpp:pubsub.movim.eu|berlin-xmpp-meetup| +Suppose you have the following nodes and items. -URL: http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup +|PubSub |Node |Item | +|--- |--- |--- | +|blog.jmp.chat |urn:xmpp:microblog:0|launch-2023 | +|news.movim.eu |Phoronix | | +|pubsub.movim.eu|berlin-xmpp-meetup |let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4| +#### To view node items -### Viewing a node item +- http://127.0.0.1:8000/atom?pubsub=news.movim.eu&node=Phoronix +- http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup -|PubSub |Node |Item | -|--- |--- |--- | -|xmpp:pubsub.movim.eu|berlin-xmpp-meetup|let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4| +#### To view a node item -URL: http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup&item=let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4 +- http://127.0.0.1:8000/atom?pubsub=blog.jmp.chat&node=urn%3Axmpp%3Amicroblog%3A0&item=launch-2023 +- http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup&item=7363a41d-1146-40b3-ac0f-8ee2559591a3 +- http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup&item=let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4 ## Author @@ -71,6 +89,6 @@ Special thanks to "d3x" and "cchianel" from IRC channel #python on irc.libera.ch ## Similar Projects -* [AtomEntry](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/AtomEntry.java) and [PubSubPublishViewImpl.java](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/PubSubPublishViewImpl.java)- Convert XMPP Pubsub Nodes to Atom Syndication Format and convey them over HTTP. +* [AtomEntry](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/AtomEntry.java) and [PubSubPublishViewImpl](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/PubSubPublishViewImpl.java)- Convert XMPP Pubsub Nodes to Atom Syndication Format and convey them over HTTP. * [AtomToPubsub](https://github.com/edhelas/atomtopubsub) - A little client that parses Atom + RSS feeds and send them on XMPP Pubsub Nodes. diff --git a/css/stylesheet.css b/css/stylesheet.css index 5035bf6..a6ebb6a 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -24,11 +24,15 @@ h1#title, h2#subtitle, #actions, #references { text-decoration: none; } -#toc { +#header, #menu { padding-bottom: 20px; } -#toc > ul > li { +#menu > h3 { + padding-left: 2%; +} + +#menu > ul > li { padding: 5px; } @@ -65,3 +69,45 @@ h1#title, h2#subtitle, #actions, #references { #articles > ul > li > div.entry h2 { font-size: 1.5vw; } + +#selection-page { + background: #000; + bottom: 0; + left: 0; + overflow: overlay; + position: fixed; + right: 0; + text-align: center; + top: 0; +} + +#selection-page h3 { + margin-left: 10%; + margin-right: 10%; +} + +#selection-page span { + display: inline-grid; + margin: 2% +} + +#selection-page img { + height: 128px; + margin-bottom: 20%; + margin-top: 20%; + width: 128px; +} + +#selection-page #selection { + margin-bottom: 5%; +} + +#selection-page #return { + font-style: italic; + margin: auto; +} + +#selection-link, #selection-page #return { + cursor: pointer; + text-decoration: underline; +} diff --git a/graphic/akregator.svg b/graphic/akregator.svg new file mode 100644 index 0000000..f8d5a3c --- /dev/null +++ b/graphic/akregator.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/graphic/leechcraft.png b/graphic/leechcraft.png new file mode 100644 index 0000000..26f69e1 Binary files /dev/null and b/graphic/leechcraft.png differ diff --git a/graphic/liferea.svg b/graphic/liferea.svg new file mode 100644 index 0000000..6d57ef0 --- /dev/null +++ b/graphic/liferea.svg @@ -0,0 +1,1310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + News + 2005-03-11 + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + news + usenet + new + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + N + E + W + S + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphic/raven.svg b/graphic/raven.svg new file mode 100644 index 0000000..ba2dd88 --- /dev/null +++ b/graphic/raven.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/graphic/rssguard.png b/graphic/rssguard.png new file mode 100644 index 0000000..9424c41 Binary files /dev/null and b/graphic/rssguard.png differ diff --git a/graphic/rssowl.svg b/graphic/rssowl.svg new file mode 100644 index 0000000..f48db68 --- /dev/null +++ b/graphic/rssowl.svg @@ -0,0 +1,513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphic/tickr.png b/graphic/tickr.png new file mode 100644 index 0000000..9020c8c Binary files /dev/null and b/graphic/tickr.png differ diff --git a/script/postprocess.js b/script/postprocess.js index e9f027f..dc37784 100644 --- a/script/postprocess.js +++ b/script/postprocess.js @@ -1,12 +1,92 @@ window.onload = function(){ - // Convert ISO8601 To UTC - for (element of document.querySelectorAll('#articles > ul > li > div > h4')) { - timeStamp = new Date(element.textContent); + // Convert ISO8601 To UTC/ + for (let element of document.querySelectorAll('#articles > ul > li > div > h4, #feed > #header > h2#subtitle.date')) { + let timeStamp = new Date(element.textContent); element.textContent = timeStamp.toUTCString(); } - // Parse Markdown - for (element of document.querySelectorAll('#articles > ul > li > div > p')) { - markDown = element.textContent + // Parse Markdown/ + for (let element of document.querySelectorAll('#articles > ul > li > div > p')) { + let markDown = element.textContent element.innerHTML = marked.parse(markDown); } + // Display a selection of suggested software. + const selection = { + 'akregator' : { + 'name' : 'Akregator', + 'image' : 'akregator.svg', + 'url' : 'https://apps.kde.org/akregator/' + }, + 'leechcraft' : { + 'name' : 'LeechCraft', + 'image' : 'leechcraft.png', + 'url' : 'https://leechcraft.org/' + }, + 'liferea' : { + 'name' : 'Liferea', + 'image' : 'liferea.svg', + 'url' : 'https://lzone.de/liferea/' + }, + 'raven' : { + 'name' : 'Raven Reader', + 'image' : 'raven.svg', + 'url' : 'https://ravenreader.app/' + }, + 'rssguard' : { + 'name' : 'RSS Guard', + 'image' : 'rssguard.png', + 'url' : 'https://github.com/martinrotter/rssguard' + }, + 'rssowl' : { + 'name' : 'RSSOwl', + 'image' : 'rssowl.svg', + 'url' : 'http://www.rssowl.org/' + }, + 'tickr' : { + 'name' : 'TICKR', + 'image' : 'tickr.png', + 'url' : 'https://www.open-tickr.net/' + } + } + let selectionLink = document.querySelector('#selection-link'); + selectionLink.addEventListener ('click', function() { + let elementDiv = document.createElement('div'); + elementDiv.id = 'selection-page'; + let elementH1 = document.createElement('h1'); + elementH1.textContent = 'Get A News Reader'; + elementDiv.appendChild(elementH1); + let elementH2 = document.createElement('h2'); + elementH2.textContent = 'Install Feed Reader Apps For Desktop And Mobile'; + elementDiv.appendChild(elementH2); + let elementH3 = document.createElement('h3'); + elementH3.textContent = '' + + 'This is a selection of desktop applications, mobile apps and online ' + + 'services for you to choose from. This selection includes news ' + + 'readers, podcast managers, torrent clients, chat bots, HTML browsers ' + + 'and plugins which support syndication feeds.'; + elementDiv.appendChild(elementH3); + const brands = Object.keys(selection); + let elementDivSel = document.createElement('div'); + elementDivSel.id = 'selection'; + for (let i = 0; i < brands.length; i++) { + let brand = brands[i]; + elementSpan = document.createElement('span'); + let elementA = document.createElement('a'); + elementA.href = selection[brand].url; + elementA.textContent = selection[brand].name; + let elementImg = document.createElement('img'); + elementImg.src = 'graphic/' + selection[brand].image; + elementSpan.appendChild(elementImg); + elementSpan.appendChild(elementA); + elementDivSel.appendChild(elementSpan); + elementDiv.appendChild(elementDivSel); + } + let elementDivReturn = document.createElement('div'); + elementDivReturn.id = 'return'; + elementDivReturn.textContent = 'Return To PubSub...'; + elementDivReturn.addEventListener ('click', function() { + document.querySelector('#selection-page').remove(); + }); + elementDiv.appendChild(elementDivReturn); + document.body.appendChild(elementDiv); + }); } diff --git a/xsl/atom_as_xhtml.xsl b/xsl/atom_as_xhtml.xsl index 6073787..83897aa 100644 --- a/xsl/atom_as_xhtml.xsl +++ b/xsl/atom_as_xhtml.xsl @@ -9,7 +9,7 @@ element inside of html element

- - - - + + + + -
+ StreamBurner

- - - - + + + + + + date + + + + date + + +

- - -
- -
    - -
  • - - - #stremburner- - - - - - - - - *** No Title *** - - - -
  • -
    -
-
-
-
-
- - - -
    - -
  • -
    - -

    - - - - - - - - - - - - - - - - stremburner- - - - - - - - - *** No Title *** - - - -

    - - - - - - - 📍 - - - - - - - 📍 - - - - - - - - 📍 - - - - - - - - - -

    - -

    -
    - -

    - -

    -
    - -

    -
    -
    - - - - -

    - - - - + +

    - - -
    -
    -
  • -
    -
-
- -
-
-
+ +
+ + + +
    + +
  • +
    + +

    + + + + + + + + + + + + + + + + stremburner- + + + + + + + + *** No Title *** + + + +

    + + + + + + + 📍 + + + + + + + 📍 + + + + + + + + 📍 + + + + + + + + + +

    + +

    +
    + +

    + +

    +
    + +

    +
    +
    + + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    +
  • +
    +
+
+ +
+
+
@@ -412,8 +420,8 @@ xmlns:atom='http://www.w3.org/2005/Atom'> This is an XMPP news feed which is conveyed as HTML, and it can even be viewed by a syndication feed reader which provides automated notifications on desktop and - mobile. Click here for a selection of - software that would fit you best! + mobile. Click here for + a selection of software that would fit you best!