Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <html>
  2. <?php
  3. require_once 'twitteroauth.php';
  4.  
  5. $oTwitter = new TwitterOAuth
  6. (
  7. 'cEW7mWiLjxuVU17CskZYTZFPd',
  8. 'ikPZ55Cx03MOLDHr3qNL2EWgJ9vkqTle7NwZcbeppB5ItyZoil',
  9. '138495038-m5BM4L9W3wqKPBEC6cm7qo7Xr1CyLOh67HqEo1TJ',
  10. '65HDY2GLDV9Yx4WX8JqDde36SdfjeoxkmGjlK1L9RSwvR');
  11.  
  12. $aFollowing = $oTwitter->get('friends/ids');
  13. $aFollowing = $aFollowing->ids;
  14. $aFollowers = $oTwitter->get('followers/ids');
  15. $aFollowers = $aFollowers->ids;
  16.  
  17. $i=1;
  18. foreach( $aFollowing as $iFollowing )
  19. {
  20. $isFollowing = in_array( $iFollowing, $aFollowers );
  21.  
  22. echo "$iFollowing: ".( $isFollowing ? 'OK' : '!!!' )."<br/>";
  23.  
  24. if( !$isFollowing )
  25. {
  26. $parameters = array( 'user_id' => $iFollowing );
  27. $status = $oTwitter->post('friendships/destroy', $parameters);
  28.  
  29.  
  30. }
  31. }
  32.  
  33. ?>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement