Kaynağa Gözat

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 6 yıl önce
ebeveyn
işleme
5316a31da5
2 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. +3
    -4
      bin/download
  2. +3
    -2
      netlify.toml

+ 3
- 4
bin/download Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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"

Yükleniyor…
İptal
Kaydet