곽교린

issue an apiKey and practice call comment in our program

AIzaSyCjBrFKnBlGvxsfOD-qJP8nBkdEoqKRHu8
\ No newline at end of file
{"web":{"client_id":"197854895056-dk8etrtt0otte8ebrra2c9lvt2k0mff4.apps.googleusercontent.com","project_id":"youtubecommentseperator","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"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","javascript_origins":["http://localhost:3031"]}}
\ No newline at end of file
This diff is collapsed. Click to expand it.
{
"dependencies": {
"googleapis": "^100.0.0",
"youtube-v3-api": "^1.1.1"
}
}
//https://www.npmjs.com/package/youtube-v3-api
//http://khuhub.khu.ac.kr/2019102147/youtube-comment-seperator.git
const apiKey = 'AIzaSyCjBrFKnBlGvxsfOD-qJP8nBkdEoqKRHu8';
const {google} = require("googleapis");
const service = google.youtube('v3');
service.commentThreads.list({
"key":apiKey,
"part":[
"snippet, replies"
],
"videoId":"m1gHR4dJhKU"//비디오 주소
}).then(function(response) {
console.log("Response", response);
console.log(response.data.items[0].snippet.topLevelComment.snippet.textDisplay)
console.log(response.data.items[1].snippet.topLevelComment.snippet.textDisplay)
},
function(err) { console.error("Execute error", err); });
/*
service.comments.list({
"key": apiKey,
"part": [
"snippet"
],
"parentId": "UgzDE2tasfmrYLyNkGt4AaABAg"
}).then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
console.log(response.data.items)
},
function(err) { console.error("Execute error", err); });
const {YoutubeDataAPI} = require("youtube-v3-api");
const {google} = require("googleapis");
const api = new YoutubeDataAPI(apiKey);
api.searchComments("https://youtu.be/m1gHR4dJhKU").then((data)=>{
console.log(data);
console.log(data.pageInfo);
},(err)=>{
console.error(err);
})
*/
\ No newline at end of file