1

如何使用 API 和 PHP 添加对 youtube 视频评论的回复?

4

2 回答 2

1

通过搜索一分钟,我发现了这个: https ://developers.google.com/youtube/2.0/developers_guide_protocol_comments#Adding_a_comment

看起来像你需要的那个。当然,您需要对想要发表评论的用户进行身份验证。

要了解如何POST在 PHP 中发出请求,请参阅这篇文章:http ://www.lornajane.net/posts/2010/three-ways-to-make-a-post-request-from-php

于 2012-06-06T13:27:44.063 回答
0

这个库似乎很容易添加回复评论:https ://github.com/jimdoescode/Zendless-PHP-YouTube-API

/**
 * Add a comment to a video or a reply to another comment.
 * To reply to a comment you must specify the commentId
 * otherwise it is just a regular comment.
 *
 * @param string $videoId the video the comment goes with.
 * @param string $comment the comment
 * @param string (optional) $commentId the id of the comment to reply to.
 * @return mixed false if not authenticated otherwise the http response is returned.
 **/

 public function addComment($videoId, $comment, $commentId = false)
于 2012-07-25T00:29:08.847 回答