Skip to content

Instantly share code, notes, and snippets.

@akshar-dave
Created August 23, 2021 05:32
Show Gist options
  • Save akshar-dave/8e133307dbf2fd4b4069f1cd259cf260 to your computer and use it in GitHub Desktop.
Save akshar-dave/8e133307dbf2fd4b4069f1cd259cf260 to your computer and use it in GitHub Desktop.
Copy Eyeem Tags
//create Copy Tags button
function createCopyTagsBtn(){
var copyTagsButton = document.createElement("button");
copyTagsButton.innerText = "Copy Tags";
copyTagsButton.classList.add('copyTagsBtn');
copyTagsButton.addEventListener('click', function(){
var res = "";
var elems = document.querySelectorAll("a.g_bubble");
elems.forEach(function(element){
res += element.innerText + ",";
})
res = res.substring(0, res.length - 1);
navigator.clipboard.writeText(res);
});
var tagsContainer = document.querySelectorAll(".pview_description")[0];
if(!document.querySelector('.copyTagsBtn')){
tagsContainer.append(copyTagsButton);
}
}
var timer1 = setInterval(function() {
try{
createCopyTagsBtn();
}
catch{
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment