Home Events! Entrance Everyone Wiki Search Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
November 24, 2024 - @798.19 (what is this?)
Forum activity rating: Three Stars Posts: 35/1k.beats ~ Boop! The forum will close in 202.beats! Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts    Start New Topic
News: :4u: :transport: More is More :transport: :4u:

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  HELP: Implementing RSS into website?


« previous next »
Pages: [1] Print
Author Topic: HELP: Implementing RSS into website?  (Read 808 times)
shevek
Sr. Member ⚓︎
****


˚₊⁀꒷₊˚︰₊︶꒦꒷₊⊹︰꒷

⛺︎ My Room
iMood: daintyeco

View Profile WWW

Thanks for being rad!First 1000 Members!Joined 2023!
« on: April 23, 2023 @913.23 »

Me again today! :drat:

To be honest, even after researching, I feel like a total noob about implementing RSS on my website, so I need to ask for help. I have two sites in there that update periodically, my Steam Deck modding journal and my Toybrick castle journal. I would love to offer people to subscribe via RSS so they know when a new entry is made on these instead of having to manually check.
I just honestly have zero idea how to do it or what to look out for especially in regards to edits - will all edits be regarded as new activity and sent out, or how can I signify a new post when they're all on the same page and just separated by dates?

I would love your input.
Logged

Odo was just an idea. Shevek is the proof.
Cobra!
Hero Member ⚓︎
*****


’S fhearr Albais bhriste na Albais sa chiste

⛺︎ My Room
StatusCafe: cobradile
iMood: Cobradile
Matrix: Chat!
XMPP: Chat!
Itch.io: My Games

View Profile WWW

Happy Birthday 2k24 !bred :3First 1000 Members!Pocket Icelogist!OG! Joined 2021!
« Reply #1 on: April 23, 2023 @924.92 »

I use easy feed editor to make the feeds, and then to insert them into the website I use this code:
Code
<link rel="alternate" type="application/rss+xml" title="RSS feed" href="yourfeed.xml" />
This is the code to tell the browser "Hey, we have an RSS feed!" and the browser adds the icon to the URL, or whatever they do with the feeds.

I also extract from the RSS feed to populate my website's news section using Javascript:
Code
let xmlContent = '';
        let news = document.getElementById('news');
        fetch('rss.xml').then((response)=> {
            response.text().then((xml)=>{
                xmlContent = xml;

                let parser = new DOMParser();
                let xmlDOM = parser.parseFromString(xmlContent, 'application/xml');
                let entries = xmlDOM.querySelectorAll('item');

                entries.forEach(entry => {
                    let entryblock = document.createElement('div');
                    entryblock.setAttribute("class", "newsItem");
                    //author
                    let content = document.createElement('strong');
                    const date = new Date(Date.parse(entry.children[1].innerHTML));
                    content.innerText = date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear() + " ";
                    entryblock.appendChild(content);
                    
                    content = document.createElement('span');
                    console.log(entry);
                    content.innerHTML = entry.children[2].childNodes[0].nodeValue;
                    entryblock.appendChild(content);
                    
                    news.appendChild(entryblock);
                });
                
            });
        });   

The children and where they are depend on what details you add to your feed (Like author, tags, preview image, etc.).

Hope this helps
Logged




“Snooping as usual, I see?”
Memory
Guest
« Reply #2 on: April 23, 2023 @930.79 »

[removed by author]
« Last Edit: July 31, 2024 @616.54 by j » Logged
tarraxahum
Full Member ⚓︎
***


Xx_O_o_xX

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: tarraxahum
iMood: tarraxahum
Matrix: Chat!

View Profile WWW

First 1000 Members!Joined 2022!
« Reply #3 on: April 23, 2023 @931.99 »

I use easy feed editor to make the feeds,

holy heck where was this when I was figuring out RSS for my sites >:(

gotta save for future use
Logged



"Why change the past, when you can own this day?" (c)
Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games

View Profile WWW

Thanks for being rad!a puppy for your travelsAlways My PalFirst 1000 Members!spring 2023!Squirtle!!!!MIDI WarriorMIDI Warrior1234 Posts!OzspeckCool Dude AwardRising Star of the Web AwardMessage BuddyPocket Icelogist!OG! Joined 2021!...
« Reply #4 on: April 23, 2023 @932.71 »

@m15o offers a web service that automatically generates feeds for you if you have your blog formatted in a certain way on your site - you just need to enter your page URL and it'll make the feed for you - https://forum.melonland.net/index.php?topic=379.0

I use it on my site (along with my own custom feed gen) and it seems to work pretty well!  :happy:
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
shevek
Sr. Member ⚓︎
****


˚₊⁀꒷₊˚︰₊︶꒦꒷₊⊹︰꒷

⛺︎ My Room
iMood: daintyeco

View Profile WWW

Thanks for being rad!First 1000 Members!Joined 2023!
« Reply #5 on: April 24, 2023 @402.03 »

Thank you all a lot, I will look into it! :unite: the solution by m15o might even work the best, since I already use their layout for these pages! I even saw the HTML Journal thing on statuscafé, but I never knew it was about RSS feeds.
Logged

Odo was just an idea. Shevek is the proof.
Memory
Guest
« Reply #6 on: April 24, 2023 @669.49 »

For editing RSS by hand (which is not too hard):

This line goes into the head part of every HTML page to detect your RSS feed:
Code
<link rel="alternate" type="application/rss+xml" title="Feed" href="feed.xml">
The RSS file is a simple text file (in my example, it's called "feed.xml"). In your HTML code, link to the RSS file like you would link to an image on your page. As I have the RSS file and the HTML pages in one directory, I can link directly to it without needing to specify any further directories (see under "href", there is just the file name of the RSS file).


The feed.xml looks like this:
Code
<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
  <channel>
    <title>Goose Attack Feed</title>
    <link>http://goose-attacks.at/</link>
    <description>New geese attack information on this feed!</description>
    <language>de-de</language>
    <copyright>Gans</copyright>
    <pubDate>20.04.21</pubDate>

  <item>
   <title>New old scrap!</title>
   <category>Tech</category>
   <description>Lots of new scrap available!</description>
   <link>scrapyard.htm</link>
   <author>Gans</author>
   <guid>scrapyard.htm</guid>
   <pubDate>01.12.22</pubDate>
  </item>

  </channel>
</rss>
When you have something new to present, you just copy one block between the <item>-tags and alter all the things. That's not the automated professional way, but if you're just using it, let's say, monthly, it's not that much work.
Logged
Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

Website size

Started by RolyBoard ✁ ∙ Web Crafting

Replies: 61
Views: 9209
Last post November 07, 2024 @539.79
by Turboblack
Website example page

Started by Icey!Board ☆ ∙ Showcase & Links

Replies: 3
Views: 2348
Last post December 16, 2021 @285.10
by cinni
Website status (Check replies for part 2)

Started by Icey!Board ☆ ∙ Showcase & Links

Replies: 8
Views: 2621
Last post December 26, 2021 @841.50
by Icey!

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi