carbocation / go-instagram

Go library for accessing Instagram REST and Search APIs
BSD 2-Clause "Simplified" License
51 stars 20 forks source link

Paginate relationships #11

Closed maggit closed 9 years ago

maggit commented 9 years ago

I noticed that the method Follows and FollowedBy didn't support pagination, I added this support, so now you can paginate between people that you follow or people that follows you. It's very simple and uses the same structure than RecentMedia, and ResponsePagination now returns Cursor if this exists.

opt := &instagram.Parameters{Count: 20, Cursor: 1232324242}
users, next, err := client.Relationships.Follows("", opt)

opt := &instagram.Parameters{Count: 20, Cursor: 1232324242}
users, _, err := client.Relationships.FollowedBy("", opt)
hamin commented 9 years ago

@carbocation can we get this merged into master? All tests seem to be passing.

hamin commented 9 years ago

:+1: