I want to follow/unfollow some friends who authorize my Twitter
app.
For example:
User signs in with my twitter application and he wants to follow some people
How does it work? I wrote some code here but not working, The session works fine, The user signs in but create/friendship not working, why?
<?php
session_start();
require_once('TwitterAPIExchange.php');
require_once('tmhOAuth.php');
require_once('tmhUtilities.php');
require_once('twitteroauth.php');
require 'twconfig.php';
echo $_SESSION['oauth_token'];
echo "<br />";
echo $_SESSION['oauth_token_secret'];
$twitteroauth = new TwitterOAuth($consumerKey, $consumerKeySecret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret'] );
$twitteroauth->post('friendships/create', array('screen_name' => 'savanpaun'));
?>
Simply put, I want people follow/unfollow friends using signup in my application directly.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…