Advertisement
Guest User

Untitled

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