diff --git a/lib/fosdem_recorder/cli.rb b/lib/fosdem_recorder/cli.rb index dbac748..2dc1913 100755 --- a/lib/fosdem_recorder/cli.rb +++ b/lib/fosdem_recorder/cli.rb @@ -37,6 +37,11 @@ module FosdemRecorder def _validate_url(url) return if url =~ %r{^https://fosdem.org/\d+/schedule/event/.*} + if url =~ %r{^https://fosdem.org/.*} + warn 'ERROR: not a schedule page. URL must contain .../schedule/event/...' + exit 1 + end + warn 'ERROR: not a fosdem stream. URL must start with https://fosdem.org/...' exit 1 end @@ -46,6 +51,14 @@ module FosdemRecorder mechanize = Mechanize.new page = mechanize.get(url) + # body_class = page.at('body').attr('class') + # if body_class != 'schedule-event' + # STDERR.puts "ERROR: Not an event schedule page!" + # exit 1 + # end + + puts body_class + title = page.title title_sane = title