Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Retrieve data from 'commentThread' list.
- Decrease 'searchList' variable before getting a new page.
- Add new data from 'response' to the 'commentsData' list.
- If we are not pass the limit of comments for the search && we are not run out of comments.
- Call the method again with a new pointer. - бесполезный коммент, я и так вижу что мы вызываем метод.
- Start actual search when all required data are gathered. - gather конечно хорошее слово, но обычно в программировании пишут 'collected'/'written' + 'data'. БТВ тут хрен пойми что тут серчится, нет объяснения что ты ищешь в списке комментов.
- */
- const GetComments = (requestData, searchLimit, commentsData) => {
- gapi.client.youtube.commentThreads.list(requestData).then((response) => {
- searchLimit -= 100;
- commentsData.push(response.result.items);
- if(searchLimit > 0 && response.result.nextPageToken != undefined){
- requestData.pageToken = response.result.nextPageToken;
- GetComments(requestData, searchLimit, commentsData);
- }else{
- SearchInList(commentsData);
- }
- }, SearchExceptionLog );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement