init commit
This commit is contained in:
3
Gemfile
Normal file
3
Gemfile
Normal file
@@ -0,0 +1,3 @@
|
||||
source 'https://rubygems.org'
|
||||
gem 'simple-rss'
|
||||
gem 'nokogiri'
|
||||
11
Readme.md
Normal file
11
Readme.md
Normal 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
14
getazure.rb
Normal 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
|
||||
Reference in New Issue
Block a user