Created
May 6, 2019 18:25
-
-
Save timfreund/2445193c0c2db651afa5586ade293df4 to your computer and use it in GitHub Desktop.
Capture youtube views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reportview(){ | |
var length = $('.ytp-progress-bar')[0].getAttribute('aria-valuemax'); | |
var title = $('h1.title')[0].innerText; | |
var payload = {}; | |
payload['length'] = length; | |
payload['title'] = title; | |
jQuery.get("http://localhost:8000/youtube", payload); | |
} | |
setTimeout(reportview, 10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment