forked from ChimeraCoder/anaconda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrate_limit_status.go
46 lines (43 loc) · 1.3 KB
/
rate_limit_status.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package anaconda
import "net/url"
type RateLimitSearchResult struct {
RateLimitContext struct {
AccessToken string `json:"access_token"`
} `json:"rate_limit_context"`
Resources struct {
Geo struct {
Similar_places struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int `json:"reset"`
} `json:"/geo/similar_places"`
Place_id struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int `json:"reset"`
} `json:"/geo/id/:place_id"`
Reverse_geocode struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int `json:"reset"`
} `json:"/geo/reverse_geocode"`
Search struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int `json:"reset"`
} `json:"/geo/search"`
} `json:"geo"`
Search struct {
Tweets struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int `json:"reset"`
} `json:"/search/tweets"`
} `json:"search"`
} `json:"resources"`
}
func (a TwitterApi) GetRateLimitStatus(v url.Values) (r RateLimitSearchResult, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/application/rate_limit_status.json", v, &r, _GET, response_ch}
return r, (<-response_ch).err
}