A command line tool to build RSS2 and ATOM feeds from a given file system using the last modification time as publish date
Feed My Files is a Java based command line tool to generate a feed from a file system, using the last modified date
to sort the feed entries. It is written in Groovy
and use Gradle
to manage the dependencies and launch an
execution.
You can launch Feed My Files using a command like the following from the project's directory:
./gradlew buildFeeds \
-ProotPath=/home/shared \
-Prss2File=/var/www/rss2.xml \
-PatomFile=/var/www/atom.xml \
-PhtmlFile=/var/www/feed.html \
-PurlPrefix=https://lab.com/newFiles \
-PfilePrefixToIgnoreInUrl=/home/shared \
-PfeedTitle="New Shared Files" \
-PfeedDescription="New shared files in our lab" \
-PfeedLink=https://lab.com/feed \
-PfileExtensionsToInclude=pdf,mp3,png
The following options are mandatory:
rootPath
: The path where the files to feed are located- any of
rss2File
,atomFile
orhtmlFile
: output file for the different supported formats.
The following options are, well, optional:
urlPrefix
: if passed, the file URLs will be built using it as a prefix (instead of them beingfile://
URLs)filePrefixToIgnoreInUrl
: if passed, it will be removed from the beginning of each file when building its URL. It can only be used ifurlPrefix
is present.feedTitle
: What to use as the title of the feedfeedDescription
: What to use as the description of the feedfeedLink
: What to use as the link of the feedfileExtensionsToInclude
: A comma-separated list of the files extensions to include in the feed
Launching Feed My Files with docker
is easy. The following command is equivalent to the one posted before, but
using docker
instead:
docker run --rm \
-v $HOME/.gradle:/root/.gradle \
-v /var/www/:/out \
-v /home/shared:/files \
-v $(pwd):/app \
java bash -c 'cd /app; ./gradlew buildFeeds -ProotPath=/files -Prss2File=/out/rss2.xml -PatomFile=/out/atom.xml -PhtmlFile=/out/feed.html -PurlPrefix=https://lab.com/newFiles -PfilePrefixToIgnoreInUrl=/files -PfeedTitle="New Shared Files" -PfeedDescription="New shared files in our lab" -PfeedLink=https://lab.com/feed -PfileExtensionsToInclude=pdf,mp3,png'