Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Build subscribe pages too

  • Loading branch information...
commit 8f7584afd4fb315592214210b867bf32ad9fa941 1 parent 9573ad7
@craigw authored
Showing with 19 additions and 4 deletions.
  1. +18 −3 bin/bercow
  2. +1 −1  lib/bercow/version.rb
View
21 bin/bercow
@@ -82,12 +82,27 @@ rss_url = "#{options['host']}#{rss_host}/rss.xml"
reference = rss.xpath("//channel/atom:link[@rel = 'self']").to_a[0]
reference['href'] = rss_url
-rss_feed = File.join options['cache'], rss_host, 'rss.xml'
+host_root = File.join options['cache'], rss_host
+rss_feed = File.join host_root, 'rss.xml'
File.open rss_feed, 'w+' do |f|
f.print rss.to_s
end
+subscribe_file = File.join host_root, 'index.html'
+itpc_url = rss_url.gsub /^http/, 'itpc'
+File.open subscribe_file, 'w+' do |f|
+ f.print <<-HTML
+ <html>
+ <head>
+ <title>Subscribe to #{options['rss']} as a podcast</title>
+ </head>
+ <body>
+ <p>Got iTunes? <a href="#{itpc_url}">Subscribe to #{options['rss']} as a podcast</a>.</p>
+ </body>
+ </html>
+ HTML
+end
+
if options['verbose']
- iptc_url = rss_url.gsub /^http/, 'itpc'
- puts "iTunes users can subscribe at #{iptc_url}"
+ puts "iTunes users can subscribe at #{itpc_url}"
end
View
2  lib/bercow/version.rb
@@ -1,3 +1,3 @@
module Bercow
- VERSION = '0.0.2'
+ VERSION = '0.0.3'
end
Please sign in to comment.
Something went wrong with that request. Please try again.