Greasemonkey script to display newer comments on YouTube – bypass censorship

Changes comments filter to “Newest first” from “Top comments”

YouTube has been raining on the parade of its content creators with demonetization, censorship and unexplained notifications disablement. Youtube comments are also being censored. The default filter is not “Newest first” or “Oldest first” but “Top comments”. Trolls will eventually game the system. I would rather see unfiltered comments. So, here it is:

// ==UserScript==
// @name        Show newer YouTube comments
// @namespace   com.vsubhash.js.show-youtube-comments-newer
// @description Automatically changes YouTube comments filter off
// @include     https://www.youtube.com/watch*
// @exclude     %exclude%
// @version     1
// @grant       none
// ==/UserScript==

 
document.addEventListener("DOMContentLoaded", startItDelayed, false);
  
function startItDelayed() {
  window.setTimeout(switchCommentsList, 10*1000);
}
 
function switchCommentsList() { 
  console.log("Showing newer comments");
  var arButtons = document.getElementsByTagName("button");
  console.log(arButtons.length);
  
  var bFound = false;
  for (var i = 0; i < arButtons.length; i++) {
    //console.log(arButtons[i].textContent);
    if (arButtons[i].textContent.trim() == "Top comments") {
      arButtons[i].click();
      bFound = true;
      break;
    }
  }
  if (bFound) {
    //console.log("Menu found--------------");
    var arButtons = document.getElementsByTagName("button");
    console.log(arButtons.length);
    for (var i = 0; i < arButtons.length; i++) {
      //console.log(arButtons[i].textContent);
      if (arButtons[i].textContent.trim() == "Newest first") {
        arButtons[i].click();
        bFound = true;
        break;
      }
    }
  }
}

Advertisements
Posted in software | Tagged , , | Leave a comment

Solution to OpenJDK’s “Connection error sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target” error

Today, I downloaded Open JDK 10 to test it against my NetCheck JAR file. It did not work. I got this error:

Connection error sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

It seems that the certificat store bundled with the open-source project does not have information on all CAs. So, I copied the certificate store files (cacerts and blacklisted.certs) from Oracle Java JRE directory and the problem got resolved.

Copy the cacert and blacklisted.certs files from Oracle Java.

Posted in news | Leave a comment

A GreaseMonkey script to generate RSS feed links for YouTube channels

Many people use RSS feeds as the primary means to access news and information. RSS is anonymous and does not require you to log in.

Though YouTube generates RSS feeds for its channels, it does not display them (to human visitors) or advertise them (to browser software). If you prefer to subscribe to YouTube videos via RSS, then you have to manually construct the the feed URL for each channel.

I decided to automate the task using this Greasemonkey script. A few seconds after a YouTube video page gets loaded, the Greasemonkey Javascript adds an RSS icon image next to the channel name. The script links the image to the RSS feed of the YouTube channel. (This RSS icon image works seamlessly as it is from Google and is used in its “News” pages.) The Greasemonkey script also adds an RSS link tag to the HTML HEAD section so that browser applications can activate their RSS feed toolbar button.

// ==UserScript==
// @name        YouTube RSS feed generator
// @namespace   com.vsubhash.js.youtube-rss-feed-generator
// @description Adds a RSS feed button to YouTube channels
// @include     https://www.youtube.com/watch*
// @version     1
// @grant       none
// ==/UserScript==

document.addEventListener("DOMContentLoaded", startItDelayed, false);
 
function startItDelayed() {
  if (document.getElementById("YT_RSS_Feed") == null) {
    window.setTimeout(addRssButton, 5000);    
  }  
}

function addRssButton() {  
  var oDivs = document.getElementsByTagName("div");
  if ((oDivs != null) && (oDivs.length > 0)) {
    
    for (var i = 0; i < oDivs.length; i++) { if (oDivs[i].className == "yt-user-info") { //console.log("YRFG Error: Here"); var oAnchors = oDivs[i].getElementsByTagName("a"); if ((oAnchors != null) && (oDivs.length>1)) {
          var bFound = false;
          for (var j = 0; j < oAnchors.length; j++) {
            //console.log("YRFG Error: " + oAnchors[j].href.substring(0, "https://www.youtube.com/channel/".length));
            if (oAnchors[j].href.substring(0, "https://www.youtube.com/channel/".length) == "https://www.youtube.com/channel/") {
              var sChannelId = oAnchors[j].href.substring("https://www.youtube.com/channel/".length);
              
              var oRssElement = document.createElement("a");
              oRssElement.id = "YT_RSS_Feed";
              oRssElement.href = "https://www.youtube.com/feeds/videos.xml?channel_id=" + sChannelId;
              oRssElement.innerHTML = "<img src=\"https://www.google.com/images/rss.png\" style=\"margin: auto 1em; \" />";
              oAnchors[j].appendChild(oRssElement);
              
              var oLinkElement = document.createElement("link");
              oLinkElement.setAttribute("rel", "alternate");
              oLinkElement.setAttribute("title", oAnchors[j].textContent);
              oLinkElement.setAttribute("type", "application/rss+xml");
              oLinkElement.setAttribute("href", "https://www.youtube.com/feeds/videos.xml?channel_id=" + sChannelId);
              document.getElementsByTagName("head")[0].appendChild(oLinkElement);
              
              bFound = true;
              break;
            }
          }
          if (bFound) { break; }
        }
      }
    }
  }
}

A YouTube channel listing in the Bamboo RSS feed reader (a Firefox add-on or extension).

RSS provides an easier way to check Youtube channels. All that matters to YouTube is that people see their ads. RSS does not block ads and so no problem. Viewers who rely on subscriptions are likely to miss new but not so fresh videos if they don’t log in regularly. (Such videos get folded/wrapped/hidden as newer videos are published.) YouTube RSS feeds can ensure that viewers are more likely to get to know about the existence of a new video.

And, to use this script, you will need the Greasemonkey add-on in the browser. It can be installed from the Firefox/Seamonkey browser add-on search page (Tools – Add-ons from the main menu).

This article has been submitted to .

Posted in software | Tagged , | Leave a comment

Sound-activated LED lights using NPN transistor

What is wrong with the multi-colored LED light? Is it real?

I have started experimenting with transistors. The amplified AC sound signal forked from the speaker (connected to the base) is enough to turn the transistor on.  The supply voltage is connected to the LED onwards to the collector and a resistor  is connected to emitter (connected to ground).

I had some strange clear transparent LEDs. They turned on when on of the signal was connected to the collector but they did not react to the speaker signal. Stragely, one of the LEDs started glowing in all sorts of colors.

UPDATE: The clear LEDs are RGB LEDs. They follow their own (color) switching rhythm and are unsuitable for being sound-reactive.

Posted in electronics | Tagged , | Leave a comment

How to download & play YouTube videos offline using Subhash Browser app for Android

Youtube videos don’t play in any of my Android devices, that is, in the browsers. I think their Javascript tries to launch the YouTube app and remains stuck there (because I delete/disable all Google apps).

Fortunately, my app has a Javasript script which lets me download the videos as a file for offline viewing.

http://www.vsubhash.com/article.asp?id=126&info=Subhash_Browser_ultimate_browser_and_RSS_feed_reader_app_for_Android

Posted in software | Tagged , , | Leave a comment

Subhash Browser & Feed Reader v2018.05.10 for Android bypasses SSL errors to enable browsing on old phones

Going as far back as Donut or Android 1.6, which have been crippled by Google.

As mentioned in the intro page of Subhash Browser:

Subhash Browser is meant for casual browsing. It is not recommended for secure browsing, financial transactions, business activities or mission-critical operations

Another new feature is in the feed reader. It usually hides deleted articles. If you want to permanently articles, you hold the delete button for a while.

Download APK installer from

http://www.vsubhash.com/article.asp?id=126&info=Subhash_Browser_Feed_Reader_app

Posted in news | Leave a comment

Subhash Browser & Feed Reader and TweetsToRSS for Android updated – v2018.04.29

Subhash Browser & Feed Reader v2018.04.29
The search function failed to find deleted articles. It also was I think unable to find articles where the search term appeared in the beginning of the title. Both bugs have been fixed.

http://www.vsubhash.com/article.asp?id=126&info=Subhash_Browser_Feed_Reader_app

TweetsToRSS v2018.04.29

As mentioned in the “Planned Obsolescence causes “This page requires some information that was not provided. Please …” article, TweetsToRSS for Android has been updated to accept Twit.bin files from the desktop version.
http://www.vsubhash.com/article.asp?id=128&info=Subhash_TweetsToRSS_your_personal_Twitter_web_server

TweetsToRSS accepts Twit.bin file (from the desktop version) if copied to the top of your storage device.

Posted in software | Tagged , , | Leave a comment