Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/scheduler_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ jobs:
git add Gemfile.lock

# Cache responses from Japan/Clubs APIs
git add _data/dojos_earth.json
git add dojos_japan.json
git add events_japan.json
git add _data/*.json
git add images/dojos

# Save GeoJSON data to render DojoMap
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cache_dojo_logos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Caching images from coderdojo.jp to local filesystem
dojos_japan = []
File.open('dojos_japan.json') do |file|
File.open('_data/dojos_japan.json') do |file|
dojos_japan = JSON.load(file, nil, symbolize_names: true, create_additions: false)
end

Expand Down
8 changes: 4 additions & 4 deletions get_data_from_japan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
EVENTS_DATA = JSON.parse Net::HTTP.get(URI.parse "#{BASE_URL}/events.json"), symbolize_names: true
EVENTS_JSON = JSON.pretty_generate EVENTS_DATA.sort_by{|dojo| dojo[:id]}

File.open("dojos_japan.json", "w") { |file| file.write(DOJOS_JSON) }
File.open("events_japan.json", "w") { |file| file.write(EVENTS_JSON) }
File.open("_data/dojos_japan.json", "w") { |file| file.write(DOJOS_JSON) }
File.open("_data/events_japan.json", "w") { |file| file.write(EVENTS_JSON) }

# Show next step for developers
puts DOJOS_JSON
puts ''
puts 'Check out JSON data you fetched by:'
puts '$ cat dojos_japan.json'
puts '$ cat _data/dojos_japan.json'
puts ''
puts EVENTS_JSON
puts ''
puts 'Check out JSON data you fetched by:'
puts '$ cat events_japan.json'
puts '$ cat _data/events_japan.json'
puts ''
4 changes: 2 additions & 2 deletions upsert_dojos_geojson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

json_load_options = { symbolize_names: true, create_additions: false }
File.open("_data/dojos_earth.json") {|file| dojos_earth = JSON.load(file, nil, json_load_options) }
File.open("dojos_japan.json") {|file| dojos_japan = JSON.load(file, nil, json_load_options) }
File.open("events_japan.json"){|file| events_japan = JSON.load(file, nil, json_load_options) }
File.open("_data/dojos_japan.json") {|file| dojos_japan = JSON.load(file, nil, json_load_options) }
File.open("_data/events_japan.json"){|file| events_japan = JSON.load(file, nil, json_load_options) }
#pp dojos_earth.first, dojos_japan.first, events_japan.first

# dojo2dojo.csv で Clubs DB と Japan DB のクラブ名を突合する
Expand Down