relationship.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package anaconda
  2. import (
  3. "net/url"
  4. )
  5. type RelationshipResponse struct {
  6. Relationship Relationship `json:"relationship"`
  7. }
  8. type Relationship struct {
  9. Target Target `json:"target"`
  10. Source Source `json:"source"`
  11. }
  12. type Target struct {
  13. Id int64 `json:"id"`
  14. Id_str string `json:"id_str"`
  15. Screen_name string `json:"screen_name"`
  16. Following bool `json:"following"`
  17. Followed_by bool `json:"followed_by"`
  18. }
  19. type Source struct {
  20. Id int64
  21. Id_str string
  22. Screen_name string
  23. Following bool
  24. Followed_by bool
  25. Can_dm bool
  26. Blocking bool
  27. Muting bool
  28. Marked_spam bool
  29. All_replies bool
  30. Want_retweets bool
  31. Notifications_enabled bool
  32. }
  33. func (a TwitterApi) GetFriendshipsShow(v url.Values) (relationshipResponse RelationshipResponse, err error) {
  34. response_ch := make(chan response)
  35. a.queryQueue <- query{a.baseUrl + "/friendships/show.json", v, &relationshipResponse, _GET, response_ch}
  36. return relationshipResponse, (<-response_ch).err
  37. }