mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-23 07:01:35 +00:00
Commit from m3o/m3o action
This commit is contained in:
36
examples/news/README.md
Executable file
36
examples/news/README.md
Executable file
@@ -0,0 +1,36 @@
|
||||
# News
|
||||
|
||||
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/News/api](https://m3o.com/News/api).
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Headlines
|
||||
|
||||
|
||||
|
||||
|
||||
[https://m3o.com/news/api#Headlines](https://m3o.com/news/api#Headlines)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/news"
|
||||
)
|
||||
|
||||
//
|
||||
func GetNewsHeadlines() {
|
||||
newsService := news.NewNewsService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := newsService.Headlines(&news.HeadlinesRequest{
|
||||
Date: "2021-11-24",
|
||||
Language: "en",
|
||||
Locale: "us",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user