Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Below is a small piece of Ruby code that I wrote to harvest mp3 files from an RSS feed. The code was designed to be run as a cron on a local machine once a day. It checks an RSS RSS2 feed for new content, looks for any mp3s listed in the enclosure tags, and if they exist, it downloads each of them to my computer, creates a SIP that DSPACE can accept, uploads the SIP to my DSpace machine, and imports it using the batch importer. I thought that someone else might be able want to use or adapt something like this.

To use the code, create a file with a name like "mp3harvester.rb". Put the code in it. Change the appropriate paths, usernames, and passwords. Ensure that you have Ruby and the referenced Gems installed. Then, just run the file on a cron job once a day.

...