Browse Source

Move Morph API url to an environment variable [skip ci]

This allows the codebase to be deployed and reference a different instance of inlink-scraper on Morph if necessary.
main
Adrian Short 5 years ago
parent
commit
5316a31da5
2 changed files with 6 additions and 6 deletions
  1. +3
    -4
      bin/download
  2. +3
    -2
      netlify.toml

+ 3
- 4
bin/download View File

@@ -5,12 +5,11 @@ require 'rest-client'
require 'json'
require 'pp'

morph_api_url = 'https://api.morph.io/adrianshort/inlink-scraper/data.json'

result = RestClient.get(morph_api_url, params: {
result = RestClient.get(ENV['MORPH_API_URL'], params: {
key: ENV['MORPH_API_KEY'],
query: "select * from applications"
})
apps = JSON.parse(result)
ScraperWiki.save_sqlite(['authority_name', 'council_reference'], apps, 'applications')
ScraperWiki.save_sqlite( \
['authority_name', 'council_reference'], apps, 'applications')

+ 3
- 2
netlify.toml View File

@@ -4,7 +4,8 @@
command = "bundle exec bin/download && bundle exec bin/petrify"

[template]
incoming-hooks = ["Morph"]
incoming-hooks = ["Morph scrape completed"]
[template.environment]
MORPH_API_KEY = "change me"
MORPH_API_KEY = "Your secret Morph API key"
MORPH_API_URL = "https://api.morph.io/adrianshort/inlink-scraper/data.json"

Loading…
Cancel
Save