var request     = require('request');

var String_Prototype_Repeat_Is_NonStandard = [
	"✩✩✩✩✩",
	"★✩✩✩✩",
	"★★✩✩✩",
	"★★★✩✩",
	"★★★★✩",
	"★★★★★"
];

bot.on( "Message", function( name, steamID, msg, group ) {
	
	var match = msg.match( /(youtube\.com\/watch\?v=|youtu\.be\/)([A-Z0-9-_]+)/i );

	if ( !match )
		return;

	request( "http://gdata.youtube.com/feeds/api/videos/" + match[2] + "?alt=json", function( error, response, body ) {

		if ( error )
			return; // Fuck Node

		var data = JSON.parse( body );

		if ( !data.entry || !data.entry.gd$rating || !data.entry.title || !data.entry.title.$t )
			return; // Fuck YouTube
		
		var entry = data.entry;

		var starCount = Math.round( entry.gd$rating.average );

		bot.sendMessage( "YouTube: " + entry.title.$t + " [" + String_Prototype_Repeat_Is_NonStandard[ starCount ] + "]", group );

	} );
} );
var request     = require('request');
var key = "AIzaSyA8OmKcw2DMNkJicyCJ0vqvf90xgeH52zE";

var String_Prototype_Repeat_Is_NonStandard = [
	"✩✩✩✩✩",
	"★✩✩✩✩",
	"★★✩✩✩",
	"★★★✩✩",
	"★★★★✩",
	"★★★★★"
];

bot.on( "Message", function( name, steamID, msg, group ) {

	var match = msg.match( /(youtube\.com\/watch\?v=|youtu\.be\/)([A-Z0-9-_]+)/i );

	if ( !match )
		return;

	request( "https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics&prettyPrint=false&maxResults=1&key=" + key + "&id=" + match[2], function( error, response, body ) {

		if ( error )
			return; // Fuck Node

		var data = JSON.parse( body );

		if ( !data.items || !data.items[0] || !data.items[0].snippet || !data.items[0].statistics || !data.items[0].statistics.likeCount || !data.items[0].statistics.dislikeCount || !data.items[0].snippet.title )
			return; // Fuck YouTube

		var entry = data.entry;

		var starCount = Math.round( 5 * (data.items[0].statistics.likeCount/(data.items[0].statistics.likeCount + data.items[0].statistics.dislikeCount)) );

		bot.sendMessage( "YouTube: " + data.items[0].snippet.title + " [" + String_Prototype_Repeat_Is_NonStandard[ starCount ] + "]", group );

	} );
} );

Fix JuiceTube to use the V3 API