Skip to content

Commit

Permalink
Merge pull request #22 from kanmu/fix_api_key_env
Browse files Browse the repository at this point in the history
Fix api key env: GOOGLE_API_KEY -> JHOL_API_KEY
  • Loading branch information
winebarrel committed Jun 18, 2023
2 parents 9fad3f8 + 9b0dbc7 commit df78958
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func parseDate(s string) time.Time {
}

func main() {
apiKey := os.Getenv("GOOGLE_API_KEY")
apiKey := os.Getenv("JHOL_API_KEY")
client := jhol.NewClient(apiKey).WithoutContext()

date := parseDate("2023-07-17")
Expand Down Expand Up @@ -63,7 +63,7 @@ Google Calendar events are limited in duration. For example, as of today (Jun 17
Check below command for details:

```sh
curl -s -H "X-goog-api-key: $GOOGLE_API_KEY" \
curl -s -H "X-goog-api-key: $JHOL_API_KEY" \
'https://www.googleapis.com/calendar/v3/calendars/ja.japanese%23holiday%40group.v.calendar.google.com/events?showDeleted=false&singleEvents=true&orderBy=startTime&timeMin=2019-01-01T00:00:00Z&maxResults=100' \
| jq -c '.items[] | {summary, start}'
```
Expand All @@ -84,7 +84,7 @@ Usage: jhol --api-key=STRING <command>
Flags:
-h, --help Show context-sensitive help.
--version
--api-key=STRING Google API Key ($GOOGLE_API_KEY)
--api-key=STRING Google API Key ($JHOL_API_KEY)
--lang="ja" Calendar language (ja, en).
Commands:
Expand All @@ -98,7 +98,7 @@ Run "jhol <command> --help" for more information on a command.
```

```
$ export GOOGLE_API_KEY=...
$ export JHOL_API_KEY=...
$ jhol next
2023-07-17 海の日
Expand Down
2 changes: 1 addition & 1 deletion _example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func parseDate(s string) time.Time {
}

func main() {
apiKey := os.Getenv("GOOGLE_API_KEY")
apiKey := os.Getenv("JHOL_API_KEY")
client := jhol.NewClient(apiKey).WithoutContext()

date := parseDate("2023-07-17")
Expand Down
2 changes: 1 addition & 1 deletion cmd/jhol/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var version string

var cli struct {
Version kong.VersionFlag
APIKey string `required:"" env:"GOOGLE_API_KEY" help:"Google API Key"`
APIKey string `required:"" env:"JHOL_API_KEY" help:"Google API Key"`
Lang string `enum:"ja,en" default:"ja" help:"Calendar language (ja, en)."`
Next subcmd.Next `cmd:"" help:"Show next holidays."`
IsHoliday subcmd.IsHoliday `cmd:"" help:"Check whether the specified date is a holiday."`
Expand Down

0 comments on commit df78958

Please sign in to comment.