/ Published in: Ruby
ruby mcm.rb >mcm.sh
chmod +x mcm.sh
./mcm.sh
chmod +x mcm.sh
./mcm.sh
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# MCM Video Home - http://technet.microsoft.com/en-us/sqlserver/ff977043.aspx # Thanks to @PaulRandal and @KimberlyLTripp # require 'rss' require 'open-uri' rss=nil open('http://www.microsoft.com/feeds/TechNet/en-us/How-to-videos/SQL_Server_2008_Microsoft_Certified_Master_(MCM)_Readiness_Videos.xml') do |f| rss = RSS::Parser.parse(f.read, false) end rss.items.each do |item| open(item.link) do |f| t=f.read u=t.scan(/http\:\/\/download.microsoft.com\/[\_A-Za-z0-9\/-]*mp4video[\(\)\_A-Za-z0-9\/-]*\.m4v/).first u=t.scan(/http\:\/\/download.microsoft.com\/[\_A-Za-z0-9\/-]*m4v[\(\)\_A-Za-z0-9\/-]*\.m4v/).first unless u puts 'curl "'+u+'" >"' + u.scan(/MCM_[\_A-Za-z0-9\(\)\/-]*\.m4v/).first + '"' end end
URL: http://technet.microsoft.com/en-us/sqlserver/ff977043.aspx