init commit

This commit is contained in:
Tommy Parnell
2014-05-28 03:54:24 -04:00
commit 1b5cc6e49b
3 changed files with 28 additions and 0 deletions

3
Gemfile Normal file
View File

@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'simple-rss'
gem 'nokogiri'

11
Readme.md Normal file
View File

@@ -0,0 +1,11 @@
## Download Azure Friday Ruby Style
Inspired by https://gist.github.com/shanselman/32a469642ac12d078cb7
To Run you need ruby and rubygems installed
in the root directory run
*gem install bundle
*bundle
*ruby getazure.rb

14
getazure.rb Normal file
View File

@@ -0,0 +1,14 @@
require 'rubygems'
require 'open-uri'
require 'Nokogiri'
xml = Nokogiri::XML(open('http://s.ch9.ms/Shows/Azure-Friday/feed/mp4high'))
item = xml.xpath('//item')
item.each do |s|
File.open("#{s.at('enclosure')['url'].to_s.split('/').last}", "wb") do |file|
puts " downloading " + s.at('enclosure')['url'].to_s.split('/').last
file.write open("#{s.at('enclosure')['url']}").read
end
end