TEST nexpage-token-demo.html

Page by page video searching
 Page Search

SEARCH VIDEOS BY KEYWORD (Search Term)

 


Search Terms to choose:
4K Ultra HD,  101 Strings,  Abba,  Alejandro Collado,  Bee Gees,  Bert Kaempfert,  Billy Vaughn,  Caravelli,  Cecil Gonzalez instrumental,  Carpenters,  Enrique Chia,  Folli Michelangelo,  Francisco Garcia guitarist,  Franck Pourcel,  Frank Chacksfield,  Guitar Mood,  Guitarras Magicas (Guitarras de Luna),  Helmut Zacharias,  Hugo Montenegro,  Hugo Strasser,  James Last,  JUAN TORREZ,  Klaus Wunderlich,  Maximo Spodek,  Nicolas de Angelis,  Paul Mauriat,  Ray Anthony,  Ray Conniff,  Richard Clayderman,  Ricky King,  Romantic Guitar,  The Shadows,
SOME USER NAMES to choose:
NOTE: - We can use "user name" as key word for searching by key word.
- But we don't take "channel title" as key word.
- Some users choose their channel title the same as user name. However we don't know about it. In general, I think that it's dificult to get "user name".

alejandrocolladoysus,
milosh9k (true user name),
pvhung20 (user name) (this user has less than 50 videos uploaded. 
So clicking on any button will give you only the same results).




If buttons are shown, you can click them to see other page
         
         
         
       
CLICK THE LINK at "title" to play

  

CLICK thumbnail (image) to play video
OR CLICK THE LINK at "channel Title" for secondary searching



SECONDARY SEARCH FOR ALL VIDEOS UPLOADED BY ONE USER

 


First click the button "Page 1" then you can click the buttons below
         
         
         
       
CLICK THE LINK at "title" to play

  

CLICK thumbnail (image) to play video


HELP AND REMARKS

For simplicity this page does not play videos continuously.
To find the page where no nextPageToken (ie it is undefined) do the following:

TEST A
Choose one search term (from "101 Strings" .. to "The Shadows"). 
For example, we chose "101 Strings".
-Click On "Page 1" and wait a bit.
- Read "JSON RESPONSE" we see:
"TotalResults": "751 031", (greater than 1000)
But 1000 = (50 vides / page) * 20 pages.
So "nextPageToken" will not be present on page 20.

=> We check:
- Click on the "19 CIQHEAA" and we still see netPageToken
- But when you click the button "20 CLYHEAA", did not see it again

TEST B
-Choose The search term "alejandrocolladoysus"
-Click On "Page 1".
- We see:
 "TotalResults": "140",
but 100 <140 <150
So "nextPageToken" will not be present on page 3 (150/50 = 3).

=> We check:
- Click on the "2 CDIQAA" still see nextPageToken
- Click on "3 CGQQAA" nextPageToken disappeared;

NOTE: at the bottom of page 3, we can read:
"nextPageToken": "undefined"
===========================================

HOW TO EXCLUDE THE VIDEOS DUPLICATED
There are 2 solutions:

1- USE jQuery function inArray(inputArray[i], outputArray):

- Create the aray totalVid = [];
- Use For-looping
- Store all videoid and playlistId into that array:
      totalVid.push (response.items [i].id.videoId)
      totalVid.push (response.items[i].id.playlistId)
- Stop for-looping when totalVid.length == 1005 // i.e totalVid.length > 1000;
- Create the ClearVid array = [];
- Execute excluding the duplicated by using the function
      clearVid = GetUnique(totalVid);

Here is the Js code of this function

function GetUnique(inputArray){
  var outputArray = [];
  for (var i = 0; i < inputArray.length; i++){
    if ((jQuery.inArray(inputArray[i], outputArray)) == -1){
      outputArray.push(inputArray[i]);
    }
  }
  return outputArray;
}

2- USE For-looping to count the sum of videoIds and playlistIds:
      sumNum = vidNum + pidNum;
   And stop searching when the number sumNum is aqual to 500
      if(sumNum == 500){return}  
  

SOURCE CODE of this webpage



Return to my blog:  

Popular posts from this blog

PHP JQUERY PROXY DEMO

PLOTTING FUNCTION GRAPH USING JAVASCRIPT (Part 2)

COPY SOURCE CODE FOR ytvideo-search.html