本文介绍了如何取消关注注册我的应用程序推特的一些朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..我想关注/取消关注一些授权我的 Twitter
应用的朋友.
I want to follow/unfollow some friends who authorize my Twitter
app.
例如:
用户使用我的推特应用程序登录,他想关注一些人
它是如何工作的?我在这里写了一些代码但不起作用,会话工作正常,用户登录但创建/友谊不起作用,为什么?
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.
推荐答案
我复制粘贴你的例子并在最后一行替换为 destroy 命令
I copy paste you example and replace in the last line with destroy command
<?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/destroy', array('user_id' => 'iduser'));
?>
这一行
$twitteroauth->post('friendships/destroy', array('user_id' => 'iduser'));
希望对你有所帮助
最好
这篇关于如何取消关注注册我的应用程序推特的一些朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论