5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-25 01:51:35 +00:00
matterbridge/vendor/github.com/peterhellberg/giphy/trending.go
2016-04-10 23:39:38 +02:00

24 lines
457 B
Go

package giphy
import "fmt"
// Trending returns a trending response from the Giphy API
func (c *Client) Trending(args ...[]string) (Trending, error) {
path := fmt.Sprintf("/gifs/trending?limit=%v", c.Limit)
req, err := c.NewRequest(path)
if err != nil {
return Trending{}, err
}
var res Trending
if _, err = c.Do(req, &res); err != nil {
return res, err
}
if len(res.Data) == 0 {
return res, ErrNoTrendingImagesFound
}
return res, nil
}