Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-24 09:55:54 +00:00
parent 610b0caa7a
commit 664e8e8299
25 changed files with 1551 additions and 1551 deletions

View File

@@ -4,6 +4,61 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/twitter/api](h
Endpoints:
## Search
Search for tweets with a simple query
[https://m3o.com/twitter/api#Search](https://m3o.com/twitter/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Search for tweets with a simple query
func SearchForTweets() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.Search(&twitter.SearchRequest{
Query: "cats",
})
fmt.Println(rsp, err)
}
```
## Trends
Get the current global trending topics
[https://m3o.com/twitter/api#Trends](https://m3o.com/twitter/api#Trends)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Get the current global trending topics
func GetTheCurrentGlobalTrendingTopics() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.Trends(&twitter.TrendsRequest{
})
fmt.Println(rsp, err)
}
```
## User
Get a user's twitter profile
@@ -61,58 +116,3 @@ Username: "m3oservices",
}
```
## Search
Search for tweets with a simple query
[https://m3o.com/twitter/api#Search](https://m3o.com/twitter/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Search for tweets with a simple query
func SearchForTweets() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.Search(&twitter.SearchRequest{
Query: "cats",
})
fmt.Println(rsp, err)
}
```
## Trends
Get the current global trending topics
[https://m3o.com/twitter/api#Trends](https://m3o.com/twitter/api#Trends)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Get the current global trending topics
func GetTheCurrentGlobalTrendingTopics() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.Trends(&twitter.TrendsRequest{
})
fmt.Println(rsp, err)
}
```