Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Created June 29, 2018 15:13
Show Gist options
  • Save dvingerh/4734dea7d50d1f2ce4978df81c750def to your computer and use it in GitHub Desktop.
Save dvingerh/4734dea7d50d1f2ce4978df81c750def to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Discord Avatar Download Button
// @version 1
// @description Read the name.
// @namespace Violentmonkey Scripts
// @grant GM_addStyle
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require https://gist.github.com/notcammy/a8b37bc2f49a76c30220d80fdd661429/raw/3148bcb32b9f0ce30cc62ee684eb60962051bcfa/jquery.initialize.js
// @match *://discordapp.com/*
// @match *://cdn.discordapp.com/*
// @run-at document-idle
//
// ==/UserScript==
$("div[class^='memberO']").initialize(function() {
var ava_url = $(this).find("div[class^='image-']").css('background-image');
ava_url = ava_url.substring(
ava_url.lastIndexOf("(") + 1,
ava_url.lastIndexOf(")")
);;
if (ava_url.length > 5) {
console.log(ava_url);
$(this).after(`<a target="_blank" href=` + ava_url + ` style="z-index: 9999; font-size: 10px;">DL</a>`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment