Feature Request - RSS Data on Mod Portal

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
dzbanek
Inserter
Inserter
Posts: 28
Joined: Sun Jul 03, 2016 8:26 am
Contact:

Re: RSS

Post by dzbanek »

You're posting rss link of specific mod. My intension was to have a list of mods that were recenly updated. So https://mods.factorio.com/

Thunder2k
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jan 28, 2021 3:14 pm
Contact:

Re: RSS

Post by Thunder2k »

dzbanek wrote:
Wed Feb 03, 2021 11:21 am
You're posting rss link of specific mod. My intension was to have a list of mods that were recenly updated. So https://mods.factorio.com/
I did understand that, but I didn't want to open a new thread because yours is already named "RSS".

But they can mybe add both, if they are implementing the RSS feature.

I also mentioned this thread in the sticky thread "One line suggestions".

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: RSS

Post by bormand »

See also: 87788

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Feature Request - RSS Data on Mod Portal

Post by Koub »

bormand wrote:
Wed Feb 03, 2021 12:16 pm
See also: 87788
[Koub] Thanks for the pointer. Merged both topics.
Koub - Please consider English is not my native language.

Thunder2k
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jan 28, 2021 3:14 pm
Contact:

Re: Feature Request - RSS Data on Mod Portal

Post by Thunder2k »

Hi. I created a workaround to monitor changes in mod updates via the API. It's a little PHP file located on my own server. It is subscribed by my TT-RSS instance which has the option "mark updated feeds unread".

Maybe some of you can use parts of this. I'm not a programmer, but I'm to lazy to check the mods manually.

Code: Select all

<?php
        header("Content-Type: application/rss+xml; charset=UTF-8");
        $rssfeed = '<?xml version="1.0" encoding="UTF-8"?>'. "\n";
        $rssfeed .= '<rss version="2.0">'. "\n";
        $rssfeed .= '<channel>'. "\n";
        $rssfeed .= '<title>Factorio Mods</title>'. "\n";
        $rssfeed .= '<link>https://mods.factorio.com/</link>'. "\n";
        $rssfeed .= '<description>Custom Feed</description>'. "\n";

        $arr = array("IndustrialRevolution","nullius","warptorio2","Krastorio2");

        foreach ($arr as &$mod) {
                $url = "https://mods.factorio.com/api/mods/".$mod."/full";
                $content = file_get_contents($url);
                $json = json_decode($content, true);

                $item = $json;

                $rssfeed .= '<item>'. "\n";
                $rssfeed .= '<title>'.$item['title'].'</title>'. "\n";
                $rssfeed .= '<link>https://mods.factorio.com/mod/'.$mod.'</link>'. "\n";    // adding domain to get the full url

                $intro = html_entity_decode($item['summary']);
                $intro = str_replace('&nbsp;', '', $intro);
                $intro = strip_tags($intro);

                $rssfeed .= '<description>' . $intro . "&lt;/p&gt; &lt;p&gt;" .'Last updated: ' .$item['updated_at'] . '</description>'. "\n";

                $date = new DateTime($item['updated_at']);
                $date->modify('+2 hours');

                $rssfeed .= '<pubDate>' . $date->format("D, d M Y H:i:s +0200") . '</pubDate>'. "\n";
                $rssfeed .= '</item>'. "\n";
        }
        $rssfeed .= '</channel>'. "\n";
        $rssfeed .= '</rss>';

        echo $rssfeed;
?>

Post Reply

Return to “Ideas and Suggestions”