Skip to content

Instantly share code, notes, and snippets.

View circlewaves's full-sized avatar

Circlewaves Webster circlewaves

View GitHub Profile
//sharing this logic because twitter doesn't give you and end point to get mutual relationships (uses zend mvc framework for requests but it is easy enough to use something else to make the API requests)
//note: $this->source variable is a standard object that holds access token and user information for the user doing the requests
$cursor = -1; //initial position for twitter API friends and follower endpoint (important for users with more then 5000 followers/friends)
do {
//get the first 5000 following ids
$client = new Zend_Http_Client;
$client->setUri('https://api.twitter.com/1/friends/ids.json');