<commit_before>// ==UserScript==
// @name        Hello World Reading and Modifying HTML Content
// @namespace   https://github.com/bgoodr/bgoodr-userscripts
// @include     http://*.youtube.*
// @include     https://*.youtube.*
// @version     1
// ==/UserScript==

// Hello_World_Reading_and_Modifying_HTML_Content.user.js

// Attribution: Originally from: http://hayageek.com/greasemonkey-tutorial/#read-modify

if(window.location.href.indexOf("v=") > 0) //If it is a valid video
{
    var userName="";
    var title="";
    var userVideos="";
    var views="";
    if(document.getElementById("eow-title"))
        title = document.getElementById("eow-title").textContent;
 
    var as = document.getElementsByTagName("a");
    for(var i=0;i<as.length;i++)
    {
        var cls =as[i].getAttribute("class");
        if(cls)
        {
            GM_log(cls+"<br>");
            if(cls.indexOf("yt-user-name") >= 0)
            {
                userName = as[i].textContent;
            }
            else
            if(cls.indexOf("yt-user-videos") >= 0)
            {
                userVideos = as[i].textContent;
             }
        }
 
    }<commit_msg>Avoid multiple execution in iFrames<commit_after>// ==UserScript==
// @name        Hello World Reading and Modifying HTML Content
// @namespace   https://github.com/bgoodr/bgoodr-userscripts
// @include     http://*.youtube.*
// @include     https://*.youtube.*
// Avoid multiple execution in iFrames: http://stackoverflow.com/questions/4190442/run-a-greasemonkey-script-only-once-per-page-load?rq=1
// @noframes
// @version     1
// ==/UserScript==

// Hello_World_Reading_and_Modifying_HTML_Content.user.js

// Attribution: Originally from: http://hayageek.com/greasemonkey-tutorial/#read-modify

// TODO: View it from https://www.youtube.com/watch?v=CIBIqaeiE2M and it does not show anything.

console.log("window.location.href ", window.location.href);

if(window.location.href.indexOf("v=") > 0) //If it is a valid video
{
    var userName="";
    var title="";
    var userVideos="";
    var views="";
    if(document.getElementById("eow-title"))
        title = document.getElementById("eow-title").textContent;
 
    var as = document.getElementsByTagName("a");
    for(var i=0;i<as.length;i++)
    {
        var cls =as[i].getAttribute("class");
        if(cls)
        {
            GM_log(cls+"<br>");
            if(cls.indexOf("yt-user-name") >= 0)
            {
                userName = as[i].textContent;
            }
            else
            if(cls.indexOf("yt-user-videos") >= 0)
            {
                userVideos = as[i].textContent;
             }
        }
 
    }
{'fraction_non_alphanumeric': 0.16066066066066065, 'fraction_numerical': 0.007132132132132132, 'mean_word_length': 2.2342233009708736, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1122772', 'n_tokens_mistral': 880, 'n_tokens_neox': 842, 'n_words': 148}