// ==UserScript==
// @name        imgur_show_user_stats_light
// @namespace   someName
// @include     http://imgur.com/user/*
// @include     https://imgur.com/user/*
// @version     0.1a
// @grant       none
// ==/UserScript==

$( window ).load(function() {
	var CLIENT_ID = "cd0695f1226536b";
	if(window.location.pathname.indexOf('/user/') === 0 && $('.button').filter('.comments').length > 0){
		var newBox = $('<div id="statsBox" class="textbox"></div>');
		var tble = $('foo<table width="100%"></table>');
		newBox.append(tble);
		newBox.insertBefore( $('.icons').filter('.textbox') );
		var username = window.location.pathname.split("/", 3)[2];
		console.log("send request for", username);
		$.ajax({
			url: 'https://api.imgur.com/3/account/'+username+'/gallery_profile',
			method: 'GET',
			headers: {
				Authorization: 'Client-ID ' + CLIENT_ID,
				Accept: 'application/json'
			},
			success: function(result) {
				console.log(result);
				tble.append($('<tr><td>Comments</td><td>'+result.data.total_gallery_comments+'</td></tr>'));
				tble.append($('<tr><td>Submissions</td><td>'+result.data.total_gallery_submissions+'</td></tr>'));
				tble.append($('<tr><td>Favorites</td><td>'+result.data.total_gallery_favorites+'</td></tr>'));
			},
			error: function(a, b, c){
				console.log('Failed to load', a, b, c);
			}
		}); 
	}
});

@@ -180,17 +180,17 @@
      0.1
-a
+b
 %0A// @gra
@@ -978,32 +978,46 @@
 Comments%3C/td%3E%3Ctd
+ align=%22right%22
 %3E'+result.data.t
@@ -1037,16 +1037,33 @@
 comments
+.toLocaleString()
 +'%3C/td%3E%3C
@@ -1109,32 +1109,46 @@
 missions%3C/td%3E%3Ctd
+ align=%22right%22
 %3E'+result.data.t
@@ -1171,16 +1171,33 @@
 missions
+.toLocaleString()
 +'%3C/td%3E%3C
@@ -1249,16 +1249,30 @@
 %3C/td%3E%3Ctd
+ align=%22right%22
 %3E'+resul
@@ -1301,16 +1301,33 @@
 avorites
+.toLocaleString()
 +'%3C/td%3E%3C

Update imgur_show_user_stats_light.user.js