Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Discord user "dan" pointed out that KSP2 mod
KSRe
(frozen in KSP-CKAN/KSP2-NetKAN#174 after its author deleted it from SpaceDock) has been posting updates at https://sourceforge.net/projects/ksre/:https://sourceforge.net/projects/ksre/files/
Currently Netkan doesn't have the ability to crawl SourceForge, but while its API documentation looks quite inadequate, it does feature RSS-format (Really Simple Syndication, not Real Solar System) feeds for each mod's files:
https://sourceforge.net/projects/ksre/rss
Changes
Now a netkan with
$kref: '#/ckan/sourceforge/ksre'
will be indexed from SourceForge based on its RSS feed. Each<item>
with a title ending in.zip
is taken to be a download, and the first one is treated as most recent.Retrieving and parsing the RSS feed went smoothly thanks to
System.ServiceModel.Syndication.SyndicationFeed
, but getting a download URL was tricky because SourceForge thought our user agent string looked too browser-like and so wasn't returning redirects, so I had to pass in an alternate user agent string.Only a few fields can be set based on the minimal metadata in the feed, but luckily the
swinfo.json
parser is able to handle the rest.