简体   繁体   English

使用“Codebird”删除推特推文

[英]Twitter Tweet Delete Using "Codebird"

$screen_name = 'demo'; $oauth_token = 'xxxxxxxx'; $oauth_secret = 'xxxxxxxxxx';

$cb = \Codebird\Codebird::getInstance();
$cb->setToken($oauth_token, $oauth_secret);

How to DELETE My Tweet using this class "Codebird"?如何使用此类“Codebird”删除我的推文?

We can Delete Twitter Tweet Using Codebird library:我们可以使用 Codebird 库删除 Twitter 推文:

$reply = $cb->statuses_destroy_ID([
             'id' => 'TWEET_ID'
]); 

There is a general way how Twitter's API methods map to Codebird function calls. Twitter 的 API 方法映射到 Codebird 函数调用有一个通用的方式。 The general rules are:一般规则是:

  1. For each slash in a Twitter API method, use an underscore in the Codebird function.对于 Twitter API 方法中的每个斜杠,请在 Codebird 函数中使用下划线。

    Example: statuses/update maps to Codebird::statuses_update() .示例: statuses/update映射到Codebird::statuses_update()

  2. For each underscore in a Twitter API method, use camelCase in the Codebird function.对于 Twitter API 方法中的每个下划线,在 Codebird 函数中使用 camelCase。

    Example: statuses/home_timeline maps to Codebird::statuses_homeTimeline() .示例: statuses/home_timeline映射到Codebird::statuses_homeTimeline()

  3. For each parameter template in method, use UPPERCASE in the Codebird function.对于方法中的每个参数模板,在 Codebird 函数中使用大写。 Also don't forget to include the parameter in your parameter list.另外不要忘记在参数列表中包含参数。

    Examples:例子:

    • statuses/delete/:id maps to Codebird::statuses_delete_ID('id=12345') . statuses/delete/:id映射到Codebird::statuses_delete_ID('id=12345')
    • users/profile_image/:screen_name maps to Codebird::users_profileImage_SCREEN_NAME('screen_name=jublonet') . users/profile_image/:screen_name映射到Codebird::users_profileImage_SCREEN_NAME('screen_name=jublonet')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM