From 7fd0d107eea8f33918be05e0a826c2021f4f70b2 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Wed, 17 Jan 2018 16:31:05 +1100 Subject: [PATCH] Expose list of pages to scrape with JavaScript https://github.com/everypolitician/viewer-sinatra/issues/15639 This exposes a dynamically generated text file with a list of URLs that should be generated with JS enabled by the static site generation process. This can be read by the script added in d8b3c9fb to determine what URLs it should scrape. It currently only contains a single line for the one page we want to scrape after JS has been run. In the future it should be relatively easy to add new URLs to this list including lists of URLs programmatically generated. Now that we have a script to do the JS scraping and a way of generating a list of URLs for this process, our next step is to add this to the build process. --- app.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.rb b/app.rb index fd2fb58da..a79626124 100644 --- a/app.rb +++ b/app.rb @@ -99,6 +99,11 @@ erb :needed end +get '/javascript_pages_to_scrape.txt' do + headers 'Content-Type' => 'text/plain' + body url('/needed.html') +end + get '/*.css' do |filename| scss :"sass/#{filename}" end