Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1006533 // Get number of views of YouTube video [WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2151L/16K/49K).

!7

p {
  S html;
  html = loadPage("https://www.youtube.com/watch?v=kTFS3V4PnQM");
  // showText(html);
  L<S> tok = htmlTok(html);
  int i = tok.indexOf([[<div class="watch-view-count">]]);
  if (i >= 0) {
    S s = tok.get(i+1);
    print("Raw views: " + s);
    print("Parsed: " + parseFirstInt(s));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006533
Snippet name: Get number of views of YouTube video [WORKS]
Eternal ID of this version: #1006533/1
Text MD5: 7ad6a9077de5067f58ac8190800bcc8c
Transpilation MD5: c261f1136b5a1cd7de4cc71958ab156c
Author: stefan
Category: javax / networking
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-15 17:43:03
Source code size: 322 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 513 / 577
Referenced in: [show references]