Skip to content

Commit

Permalink
Revert tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
westy92 committed May 8, 2024
1 parent 1b1d71a commit ae591f1
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,65 +25,65 @@ go get github.com/westy92/holiday-event-api-go

```go
import (
"fmt"
"fmt"

holidays "github.com/westy92/holiday-event-api-go"
holidays "github.com/westy92/holiday-event-api-go"
)

func main() {
// Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
client, err := holidays.New(holidays.ApiLayer, "<your API key>")

if err != nil {
fmt.Println(err)
return
}

// Get Events for a given Date
events, err := client.GetEvents(holidays.GetEventsRequest{
// These parameters are the defaults but can be specified:
// Date: "today",
// Timezone: "America/Chicago",
// Adult: false,
})

if err != nil {
fmt.Println(err)
return
}

event := events.Events[0]
fmt.Printf("Today is %s! Find more information at: %s.\n", event.Name, event.Url)
fmt.Printf("Rate limit remaining: %d/%d (month).\n", events.RateLimit.RemainingMonth, events.RateLimit.LimitMonth)

// Get Event Information
eventInfo, err := client.GetEventInfo(holidays.GetEventInfoRequest{
Id: event.Id,
// These parameters can be specified to calculate the range of eventInfo.Event.Occurrences
// Start: 2020,
// End: 2030,
})

if err != nil {
fmt.Println(err)
return
}

fmt.Printf("The Event's hashtags are %q.\n", eventInfo.Event.Hashtags)

// Search for Events
query := "pizza day"
search, err := client.Search(holidays.SearchRequest{
Query: query,
// These parameters are the defaults but can be specified:
// Adult: false,
})

if err != nil {
fmt.Println(err)
return
}

fmt.Printf("Found %d events, including %s, that match the query \"%s\".\n", len(search.Events), search.Events[0].Name, query)
// Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
client, err := holidays.New(holidays.ApiLayer, "<your API key>")

if err != nil {
fmt.Println(err)
return
}

// Get Events for a given Date
events, err := client.GetEvents(holidays.GetEventsRequest{
// These parameters are the defaults but can be specified:
// Date: "today",
// Timezone: "America/Chicago",
// Adult: false,
})

if err != nil {
fmt.Println(err)
return
}

event := events.Events[0]
fmt.Printf("Today is %s! Find more information at: %s.\n", event.Name, event.Url)
fmt.Printf("Rate limit remaining: %d/%d (month).\n", events.RateLimit.RemainingMonth, events.RateLimit.LimitMonth)

// Get Event Information
eventInfo, err := client.GetEventInfo(holidays.GetEventInfoRequest{
Id: event.Id,
// These parameters can be specified to calculate the range of eventInfo.Event.Occurrences
// Start: 2020,
// End: 2030,
})

if err != nil {
fmt.Println(err)
return
}

fmt.Printf("The Event's hashtags are %q.\n", eventInfo.Event.Hashtags)

// Search for Events
query := "pizza day"
search, err := client.Search(holidays.SearchRequest{
Query: query,
// These parameters are the defaults but can be specified:
// Adult: false,
})

if err != nil {
fmt.Println(err)
return
}

fmt.Printf("Found %d events, including %s, that match the query \"%s\".\n", len(search.Events), search.Events[0].Name, query)
}
```

0 comments on commit ae591f1

Please sign in to comment.