mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
#21: added web hook for paper scraper notification
This commit is contained in:
parent
e3a81fea4c
commit
6b1b85c6df
2 changed files with 12 additions and 3 deletions
9
app/controllers/import_controller.rb
Normal file
9
app/controllers/import_controller.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class ImportController < ApplicationController
|
||||
def new_papers_callback
|
||||
require 'open-uri'
|
||||
api_key = Rails.application.config_for(:morph)["key"]
|
||||
uri = URI.parse("https://api.morph.io/jrlover/city_council_leipzig_recent_papers/data.json?key=#{api_key}&query=select%20*%20from%20%27data%27")
|
||||
Paper.import_from_json(uri.read)
|
||||
render :nothing => true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue