[twitter-dev] Re: abrahams twitteroauth issue
Thank you Abraham for your support, I appreciate it very mutch. My current code: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); $totaal = count($followers); while ($totaal 1) { for($x=0; $x$totaal; $x++) { // Removed code here since its not have a issue with cursor } } $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); $totaal = count($followers); $cursor++; } Thanks. On 18 jul, 02:10, Abraham Williams 4bra...@gmail.com wrote: It should be possible to do everything the REST API currently supports other then uploading images which will be in the next beta. Feel free to send me code samples of what you are having issues with. Abraham - Abraham Williams | Hacker Advocate |http://abrah.am @abraham |http://projects.abrah.am|http://blog.abrah.am This email is: [ ] shareable [x] ask first [ ] private. On Mon, Jun 28, 2010 at 02:34, Rick rickstuivenb...@gmail.com wrote: Hello, Is it even possible to use abrahams twitteroauth library to get all the followers the way I want it. I screwed up and now I must rewrite the cursor idea, Is anybody having a example code for the abrahams twitteroauth. Thank you On 25 jun, 21:50, Sam Wierema samwier...@gmail.com wrote: Yes, it's very possible. Haven't tested it, but it should be something like this: $cursor = -1; while( $cursor !== 0 ) { $info = $oauth-get( 'statuses/followers', array( 'cursor' = $cursor ) ); if( $oauth-http_code === 200 !isset( $info-error ) ) { // Count or whatever here $cursor = $info-next_cursor; } } If you just want to count all of your followers, why not do users/ show? That contains a followers_count variable in it. On Jun 25, 4:18 pm, Rick rickstuivenb...@gmail.com wrote: Thank you for your reply. I don't use next_cursor or whatsoever. I just use the $followers variable to use count it with $totaal = count($followers); so I can use it in my code. The cursor code I posted before is the only thing I use to try and get information. Is it even possible to get all the followers with the abrahams twitter library? On 25 jun, 15:11, Sam Wierema samwier...@gmail.com wrote: You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick
Re: [twitter-dev] Re: abrahams twitteroauth issue
It should be possible to do everything the REST API currently supports other then uploading images which will be in the next beta. Feel free to send me code samples of what you are having issues with. Abraham - Abraham Williams | Hacker Advocate | http://abrah.am @abraham | http://projects.abrah.am | http://blog.abrah.am This email is: [ ] shareable [x] ask first [ ] private. On Mon, Jun 28, 2010 at 02:34, Rick rickstuivenb...@gmail.com wrote: Hello, Is it even possible to use abrahams twitteroauth library to get all the followers the way I want it. I screwed up and now I must rewrite the cursor idea, Is anybody having a example code for the abrahams twitteroauth. Thank you On 25 jun, 21:50, Sam Wierema samwier...@gmail.com wrote: Yes, it's very possible. Haven't tested it, but it should be something like this: $cursor = -1; while( $cursor !== 0 ) { $info = $oauth-get( 'statuses/followers', array( 'cursor' = $cursor ) ); if( $oauth-http_code === 200 !isset( $info-error ) ) { // Count or whatever here $cursor = $info-next_cursor; } } If you just want to count all of your followers, why not do users/ show? That contains a followers_count variable in it. On Jun 25, 4:18 pm, Rick rickstuivenb...@gmail.com wrote: Thank you for your reply. I don't use next_cursor or whatsoever. I just use the $followers variable to use count it with $totaal = count($followers); so I can use it in my code. The cursor code I posted before is the only thing I use to try and get information. Is it even possible to get all the followers with the abrahams twitter library? On 25 jun, 15:11, Sam Wierema samwier...@gmail.com wrote: You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick
[twitter-dev] Re: abrahams twitteroauth issue
Hello, Is it even possible to use abrahams twitteroauth library to get all the followers the way I want it. I screwed up and now I must rewrite the cursor idea, Is anybody having a example code for the abrahams twitteroauth. Thank you On 25 jun, 21:50, Sam Wierema samwier...@gmail.com wrote: Yes, it's very possible. Haven't tested it, but it should be something like this: $cursor = -1; while( $cursor !== 0 ) { $info = $oauth-get( 'statuses/followers', array( 'cursor' = $cursor ) ); if( $oauth-http_code === 200 !isset( $info-error ) ) { // Count or whatever here $cursor = $info-next_cursor; } } If you just want to count all of your followers, why not do users/ show? That contains a followers_count variable in it. On Jun 25, 4:18 pm, Rick rickstuivenb...@gmail.com wrote: Thank you for your reply. I don't use next_cursor or whatsoever. I just use the $followers variable to use count it with $totaal = count($followers); so I can use it in my code. The cursor code I posted before is the only thing I use to try and get information. Is it even possible to get all the followers with the abrahams twitter library? On 25 jun, 15:11, Sam Wierema samwier...@gmail.com wrote: You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick
[twitter-dev] Re: abrahams twitteroauth issue
You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick
[twitter-dev] Re: abrahams twitteroauth issue
Thank you for your reply. I don't use next_cursor or whatsoever. I just use the $followers variable to use count it with $totaal = count($followers); so I can use it in my code. The cursor code I posted before is the only thing I use to try and get information. Is it even possible to get all the followers with the abrahams twitter library? On 25 jun, 15:11, Sam Wierema samwier...@gmail.com wrote: You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick
[twitter-dev] Re: abrahams twitteroauth issue
Yes, it's very possible. Haven't tested it, but it should be something like this: $cursor = -1; while( $cursor !== 0 ) { $info = $oauth-get( 'statuses/followers', array( 'cursor' = $cursor ) ); if( $oauth-http_code === 200 !isset( $info-error ) ) { // Count or whatever here $cursor = $info-next_cursor; } } If you just want to count all of your followers, why not do users/ show? That contains a followers_count variable in it. On Jun 25, 4:18 pm, Rick rickstuivenb...@gmail.com wrote: Thank you for your reply. I don't use next_cursor or whatsoever. I just use the $followers variable to use count it with $totaal = count($followers); so I can use it in my code. The cursor code I posted before is the only thing I use to try and get information. Is it even possible to get all the followers with the abrahams twitter library? On 25 jun, 15:11, Sam Wierema samwier...@gmail.com wrote: You should not increment your cursor, because Twitter returns a cursor for you. And if cursor is 0, it means that there are no more pages (-1 + 1 = 0). Check your $followers variable that you got from the first call. It should be called something like next_cursor. On Jun 25, 2:26 pm, Rick rickstuivenb...@gmail.com wrote: Howdy! I am currently making my application OAuth compatible from basic auth, currently I have a issue I need to get resolved in order to switch to the new OAuth method. I am getting my followers from: $oauth-get('statuses/followers'); but that only gives me the last 100 followers, I trought it would be easy to do it this way: $cursor = -1; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); // Other code here.. $cursor++; $followers = $oauth-get('statuses/followers', array('cursor' = $cursor)); Is it possible to get all my users, because this code does not work and my inspiration was wrong. Hopefully you can help me. Regards, Rick