Bookmarklet For Increasing YouTube Speed

I made a new tiny bookmarklet to let you increase the speed of a YouTube video beyond 2x.

As always, just drag this link to the bookmark bar on your browser, then just start a YouTube video, once the video starts, click the bookmark, and enter how many “x” you want the video played at. I usually stick to 2.5 or possibly 3, it all depends on the video – but you do you!

YouTube Speed

The code is pretty simple and easily found online, but just in case that’s what you are looking for:

(function(){
document.getElementsByTagName('video')[0].playbackRate = window.prompt('Please enter a new speed:');
})();

Posted in javascript, programming, YouTube | 2 Comments

SocialAssemble!

Assemble for Socially Distant Learning.

We created a website to help people connect to teach classes/skill remotely during the Covid-19 pandemic. It’s a simple project based off Google Calendar.

You can see the site here: https://socialassemble.com/

And also, you are welcome to fork the project and setup your own version!

https://github.com/aWholeCompany/socialassemble.com

Posted in Github, javascript, programming | Leave a comment

Facebag – A Chrome Extension to make Facebook less interactive!

Long time no update! Well, I just made myself a little Chrome Extension for Facebook. All it does is delete the comment boxes, status box and like buttons from Facebook, so that I don’t use them. It’s great for me! I am considering adding other things to it as well, but for now this was quick and dirty and did what I wanted!

Chrome Store Link

Github Repo

Posted in Facebook, GIT, Github, javascript, programming | Leave a comment

Netflix Autoplay Chrome Extension – v0.8 – Chromecast Support!

I put out an update the other night, this one adds support for Chromecast.

And it looks like I was just in time for the new season of Orange Is the New Black, so get your binge on!

Web Store: https://chrome.google.com/webstore/detail/netflix-autoplayer-with-s/adegickccmlojbmbmemgjakpoammfmkg?utm_source=chrome-ntp-icon

Github: https://github.com/rtpmatt/Netflix-Autoplay-Chrome-Extension

Posted in Github, javascript, Netflix, programming | 3 Comments

Netflix Autoplay Chrome Extension – Still More Updates

I have added still more updated to my Chrome extension.

0.6 Updates:
*Added episode counter in addition to timer
*Pausing video stops timer
*Fixed bugs when stopping

0.5 Updates:
*Play/Pause, Next and Stop media buttons on keyboard now work with Netflix.
*ctrl+q now causes the same action as the sleep timer ending (ex: pause movie & sleep).

Chrome store link: https://chrome.google.com/webstore/detail/netflix-autoplayer-with-s/adegickccmlojbmbmemgjakpoammfmkg?utm_source=chrome-ntp-icon

Github link: https://github.com/rtpmatt/Netflix-Autoplay-Chrome-Extension

Posted in Github, javascript, Netflix, programming | Leave a comment

Netflix Autoplay Chrome Extension with Computer Sleep / Shutdown – Updates

I have added a number of updates to my Netflix autoplay extension. In addition to autoplaying TV episodes and shutting down when done, it now also adds support for the keyboard media keys play/pause, next, and stop to Netflix, and also adds a new keyboard shortcut of ctrl+q which does the same thing that will happen when the timer reaches zero. The extension and Github have both been updated.

Also, a little while ago I added default value options for the popup that can be set in the extension option.

Github: https://github.com/rtpmatt/Netflix-Autoplay-Chrome-Extension

Chrome Store Link: https://chrome.google.com/webstore/detail/netflix-autoplayer-with-s/adegickccmlojbmbmemgjakpoammfmkg?utm_source=chrome-ntp-icon

Posted in Github, javascript, Netflix, programming | Leave a comment

Netflix Autoplay Chrome Extension – With System Sleep!

Bookmarklets are cool and all that, but what I have really always wanted the autoplay functionality for Netflix to do is emulate the ‘Sleep Timer’ found on most TVs. That is, I want it to play for some amount of them, and when done, shut everything off. I know I am not the only person around who has used the function on the TV for years while going to sleep. I have known that this is not possible using just a bookmarklet, but I never got the energy up to actually figure out how to make one. One of the reasons is that I have always known that calling something external like the Shutdown/Sleep command on the computer would be a huge pain. This new HTML5 video Netflix is using for Chrome though made it just a bit too tempting.

The core functionality works basically the same way as this one, since Chrome extensions just use Javascript. I had to figure out how to do all the fancy stuff that makes it an extension, AND add the stuff to allow it to interact with the system to call the Sleep command.

And here it is: Netflix Autoplayer – Chrome Extension

IMPORTANT:
For the ‘Sleep’ functionality to work, once you have installed the extension, you must download the install.bat file that you will see a link for at the bottom of the dialog for the extension. You must run this (and I believe you might need administrator privileges when you do) it creates a couple files that are needed and adds a registry entry. Really, in general I would say you should not do something like that. You shouldn’t be running random things people on the internet tell you to. If you want the ‘Sleep’ to work though, that’s what you need to do. If you understand how .bat files work, it is actually really small, so you can check out what it is doing.

Once you have done the above you can actually edit one of the files it creates, it is located at:
%LOCALAPPDATA%\Netflix-Autoplay\shutdown.bat

And by default should have the following:

:: Lock
::rundll32.exe User32.dll,LockWorkStation
:: Shutdown
::Shutdown.exe -s -t 00
:: Hibernate
::rundll32.exe PowrProf.dll,SetSuspendState
:: Sleep
rundll32.exe powrprof.dll,SetSuspendState 0,1,0

As you can see, ‘Sleep’ is what it does by default, but I have entries for Hibernate, Shutdown, and Lock all listed, just uncomment the one you want and comment the others back out…Hell if you want you could really put anything you like in that file and make it run anything when the timer gets to zero.

Chrome Web Store Link: https://chrome.google.com/webstore/detail/netflix-autoplayer/adegickccmlojbmbmemgjakpoammfmkg?utm_source=chrome-ntp-icon

Github Link: https://github.com/rtpmatt/Netflix-Autoplay-Chrome-Extension

Hope you enjoy!

Posted in Github, javascript, Netflix, programming | Leave a comment

NEW Netflix Autoplay Bookmarklet!

GOOD NEWS EVERYONE!

I was checking out Netflix today, and they seem to have moved to an HTML5 video player (for me in Chrome at least, and that is all I tested). This is awesome news as it made writing a new autoplay bookmarklet easy as shit! They also got rid if the bit of Javascript they were trying to use to prevent you from using the console. I don’t know why they made the decision to get rid of that, it could be because they know it is a dumb idea and anybody who actually knows what they are doing can get around it, it could be because they are now OK with people playing around, it could be just an accident, but I am going to take personal credit for it because of this post: I Don’t Like Being Told What I Can and Can’t Do.

Anyway, as I said, this awesome new HTML5 video player made my job super easy – as you can see by how much less code there is this time…and here it is:

'use strict';
(function(undefined){
	//Check if user has already loaded an instance - if so, just update the play time;
	if(window._ME && window._ME.autoplayer) {
		//Get desired play time extension & convert to miliseconds
		window._ME.autoplayer.playTime = window.prompt('Autoplay already started! Updating playtime. \n How many more minutes would you like to play for?') * 60 * 1000;
		if(isNaN(window._ME.autoplayer.playTime)) {
			window.alert('That\'s not a number jackass.');
		}
		window._ME.autoplayer.startTime = new Date();
		return;
	}

	window._ME = {
		autoplayer: {}
	};

	//Get desired play time & convert to miliseconds
	window._ME.autoplayer.playTime = window.prompt('How many minutes would you like to play for?') * 60 * 1000;
	if(isNaN(window._ME.autoplayer.playTime)) {
		window.alert('That\'s not a number jackass.');
	}	
	window._ME.autoplayer.startTime = new Date();
	var lastUpdate = new Date();

	//Checks if the video has stopped or if we are done playing once a second
	window._ME.autoplayer.interval = setInterval(function() {
		var currentTime = new Date();

		// Check if autoplay-interrupt has fired
		if(document.getElementsByClassName('player-autoplay-interrupter').length > 0 && document.getElementsByClassName('continue-playing').length > 0) {
			//Just click the continue button!
			document.getElementsByClassName('continue-playing')[0].click();
		} 

		//Check if at end of season
		if (document.getElementsByClassName('player-postplay-autoplay-header') && document.getElementsByTagName('video').length === 0 && document.getElementsByClassName('player-postplay-still-hover').length > 0) {
			//Click the next video picture
			document.getElementsByClassName('player-postplay-still-hover')[0].click();
		}	

		//Check if we have reached the users max play time
		if(window._ME.autoplayer.playTime && currentTime - window._ME.autoplayer.startTime > window._ME.autoplayer.playTime && document.getElementsByClassName('player-play-pause').length > 0) {
			//click the pause button
			document.getElementsByClassName('player-play-pause')[0].click();

			//remove all traces of this autoplayer
			clearInterval(window._ME.autoplayer.interval);
			delete(window._ME);
		}

		lastUpdate = currentTime;
	}, 1000);
})();

Basically all I had to do this time was watch for when the right elements popup on the screen, and when they do, click them. Thank you Netflix!

The Thing You Want:
Here is the Bookmarklet: Netflix Autoplay

I also made a couple of extra bookmarklets because it was so easy.

Restart the timer:

(function() {
	window._ME.autoplayer.startTime = new Date();
})();
Bookmarklet: Restart Timer

Turn off Autoplay:

(function() {
	clearInterval(window._ME.autoplayer.interval);
	delete(window._ME);
})();
Bookmarklet: Turn off Autoplay

If you are new to this, to use these, simply drag those links up to your bookmark bar, then start up the TV show you want to watch, and click the first bookmark.

The bookmarklet will ask you how long you want to play for, and it will pause the video and remove itself when it hits that time limit. For never-ending play, just enter “0”.
-If you hit it a second time, it will as you again how long you want to play for, and restart the timer with the new length.

If you hit the second bookmarklet I have there, it will restart the timer. Meaning that if you put in “60” (for 1 hour of play time) hitting it will restart the countdown back to 60 minutes.

If you hit the third bookmarklet, it will remove all traces of the bookmarklet from the page (basically the same as just hitting refresh on the page).

This should have no problem with multiple seasons, or any of that fancy stuff. Let me know if you find any bugs, I may do something about them I guess.

And I should have this up on GitHub shortly here: https://github.com/rtpmatt/Netflix-HTML5-Autoplay-Bookmarklet

Update:
Yeah, I just tried this in FireFox, and apparently it still uses SilverLight, not HTML5 videos, so this wont work at all in it. So, please don’t tell me about how it is broken in FireFox, I will not be doing anything about that…If you are using IE, then I REALLLY don’t care if it works or not. If you send me anything about your IE situation I may send you back an insult, or possibly a picture of a cat butt, that might be fun for you I guess? I don’t know if you will be able to view them on IE though.

Posted in Github, javascript, Netflix, programming | 3 Comments

Comments…

Well, I just deleted over 56,000 comments from my database. I hope I didn’t delete any ACTUAL comments. Fucking spammers. I may have some new stuff to post soon. I have been working with AngularJS recently…Might be cooking up something fun.

Posted in AngularJS, javascript, programming, Uncategorized | Leave a comment

Checking for global scope leak

Last night I got a wild hair and wanted to write a bit of code for fun. Basically I wanted to see what variables were added to the global scope by different libs and bits of code. Basically you can run this and it will tell you if you have accidentally left off a var or added something to the global namspace in some other way. It is rather simple, it does add a var to the global, but I remove that at the end so you don’t see funny results.

To run it, simply replace the:

<script src="jquery-2.1.3.js" type="text/javascript"></script>

with whichever files you wish to check. The code is pretty simple:


<html><head>
	   <title>What's New</title>
    </head>
<body>

	<script type="text/javascript">
		_cleanWindow = Object.getOwnPropertyNames(window);
	</script>

	<script src="jquery-2.1.3.js" type="text/javascript"></script>

	<script type="text/javascript">
		(function(){
			var _modifiedWindow = Object.getOwnPropertyNames(window);
			var _newShit = {};
			var i = j = 0;
			var output = '<\/ br>';


			for(i = 0; i <= _modifiedWindow.length; i++) {
				for(j = 0; j <= _cleanWindow.length; j++) {
					if(_cleanWindow[j] === _modifiedWindow[i]) {
						break;
					}

					if(j === _cleanWindow.length &amp;&amp; _modifiedWindow[i] !== '_cleanWindow') {
						_newShit[_modifiedWindow[i]] = _modifiedWindow[i];
					}
				}
			}

			for(prop in _newShit) {
				output += prop + ': ' + window[prop] + '<br>';
			}

			document.body.innerHTML += output;

		})();
	</script>

</body></html>
Posted in javascript, programming | Leave a comment