fix: Make sure pages are from FOSDEM website
This commit is contained in:
parent
1ffd522e66
commit
f0a1d7f136
1 changed files with 13 additions and 0 deletions
|
@ -37,6 +37,11 @@ module FosdemRecorder
|
||||||
def _validate_url(url)
|
def _validate_url(url)
|
||||||
return if url =~ %r{^https://fosdem.org/\d+/schedule/event/.*}
|
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/...'
|
warn 'ERROR: not a fosdem stream. URL must start with https://fosdem.org/...'
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
@ -46,6 +51,14 @@ module FosdemRecorder
|
||||||
mechanize = Mechanize.new
|
mechanize = Mechanize.new
|
||||||
page = mechanize.get(url)
|
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 = page.title
|
||||||
title_sane =
|
title_sane =
|
||||||
title
|
title
|
||||||
|
|
Loading…
Add table
Reference in a new issue