Skip to content

Commit

Permalink
Use JSON instead of YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Oct 12, 2024
1 parent 44f4b23 commit 916e53b
Show file tree
Hide file tree
Showing 223 changed files with 1,341,831 additions and 931,756 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update Data

on:
schedule:
- cron: '0 2 * * 0'

jobs:
update-data:
name: Update Data
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Update Data
run: |
./bin/update_data
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.SOMLENG_PERSONAL_ACCESS_TOKEN }}
commit-message: "feat: Update data"
title: "feat: Update data"
labels: "update_data"
base: "main"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RateCenter.load(:cities, only: { us: [:ny, :ca] }) # Loads cities in New York an
city = RateCenter::City.find_by!(country: "US", region: "NY", name: "New York")
city.lat # "40.6943"
city.log # "-73.9249"
city.county # Queens
city.nearby_rate_centers.each do |rate_center|
puts "Rate Center: #{rate_center.name}, Distance: #{rate_center.distance_km} km"
end
Expand All @@ -78,6 +79,10 @@ end
# Rate Center: NASSAUZN03, Distance: 20.16 km
```

### Not using Ruby?

The [data](https://github.com/somleng/rate_center/tree/main/data) directory contains all the data in JSON files.

## Updating Data

In order to pull data from the sources, run the following script
Expand Down
Loading

0 comments on commit 916e53b

Please sign in to comment.