如何使用PHP使用API添加对youtube视频评论的回复?
答案 0 :(得分:1)
通过搜索一分钟,我发现了这个: https://developers.google.com/youtube/2.0/developers_guide_protocol_comments#Adding_a_comment
看起来像你需要的那个。当然,您需要对想要发表评论的用户进行身份验证。
要了解如何在PHP中发出POST
请求,请参阅此文章:http://www.lornajane.net/posts/2010/three-ways-to-make-a-post-request-from-php
答案 1 :(得分: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)