Skip to content

Instantly share code, notes, and snippets.

@qubodup
Created August 10, 2023 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qubodup/c8774ec15a8aeee188f3945ccf487af8 to your computer and use it in GitHub Desktop.
Save qubodup/c8774ec15a8aeee188f3945ccf487af8 to your computer and use it in GitHub Desktop.
Copy OpenClipArt tags easily from a text box
// ==UserScript==
// @name OpenClipart Tag Copy Helper
// @namespace https://github.com/qubodup
// @version 0.1
// @description makes copying tags easier, for remixing
// @author qubodup
// @match https://openclipart.org/detail/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=openclipart.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
// https://stackoverflow.com/a/12897970/188159
window.addEventListener('load', function() {
// https://stackoverflow.com/questions/16570564/jquery-get-an-array-of-text
var array = $('.clipart-detail-meta > dl > dd > a').map(function(){
return $.trim($(this).text());
}).get();
var tagtext = array.join(', ')
$('.clipart-detail-meta > dl').after('<textarea style="width:100%">' + tagtext + '</textarea>');
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment