Last active
July 17, 2016 15:03
-
-
Save pldubouilh/5400fc1c6baa805b195365b65a8797e7 to your computer and use it in GitHub Desktop.
Get your podcasts ready right after their broadcast 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Needs to be in /var/www/html/channel.yml | |
| :title: 'All About Everything' | |
| :description: 'A show about everything' | |
| :url: 'https://www.server.com/data' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Creates a podcast feed at server.com/feed.xml | |
| # Podcasts will be in server.com/data/*.mp3 | |
| # Needs ffmpeg and dropcaster ( gem install dropcaster ) | |
| ( ffmpeg -i "http://audio.scdn.arkena.com/11008/franceinter-midfi128.mp3" -acodec copy -vcodec copy -metadata title=`date +%D` /var/www/html/f/data/`date +"%s"`.mp3 ) & pid=$! | |
| ( sleep 4314 && kill $pid ) 2>/dev/null & watcher=$! | |
| if wait $pid 2>/dev/null; then | |
| echo "finished" | |
| pkill -HUP -P $watcher | |
| wait $watcher | |
| else | |
| sleep 2 | |
| find /var/www/html/data/*.mp3 -mtime +10 -exec rm {} \; # Keep only 10 | |
| cd /var/www/html && /usr/local/bin/./dropcaster data > feed.xml # Create xml for podcast players | |
| fi | |
| # Wow, so easy to crontab' ! | |
| # 50 7 * * * bash /home/user/podcaster.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment