NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Show_User_Info_On_Post // @namespace Thingy // @include http://imgur.com/gallery/* // @include https://imgur.com/gallery/* // @version 1.1 // @grant none // @license MIT // ==/UserScript== function create_span() { $('.post-title-meta').append($('<br><span id="PostCount" style="color: rgb(153, 153, 153); display="none"">.</span>')); $('.post-title-meta').append($('<span id="CommentCount" style="color: rgb(153, 153, 153); display="none"">.</span>')); $('.post-title-meta').append($('<span id="Favorites" style="color: rgb(153, 153, 153); display="none"">.</span>')); } function Check_Post(run) { var CLIENT_ID = "59e8030767a0c8c"; var username = $('.post-account').text(); $.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) { $('span#PostCount').text("Posts: " + result.data.total_gallery_submissions); $('span#CommentCount').text("Comments: " + result.data.total_gallery_comments); $('span#Favorites').text("Favourites: " + result.data.total_gallery_favorites); var run = 1; }, error: function(a, b, c){ console.log('Failed to load', a, b, c); } }); } function start(){ create_span(); Check_Post(); } $(document).ajaxStop(function(){ $(this).unbind("ajaxStop"); start(); });