SHARE
TWEET

Untitled

a guest Jun 19th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Shutterstock Keywords
  3. // @author        skillup (skillup.lj.ru)
  4. // @source        http://skillup.lj.ru
  5. // @version       1.3
  6. // @description   Easy to copy image keywords.
  7. // @include       https://www.shutterstock.com/image-photo/*
  8. // @include       https://www.shutterstock.com/image-vector/*
  9. // @include       https://www.shutterstock.com/image-illustration/*
  10. // ==/UserScript==
  11.  
  12. (() => {
  13.     let keywords = document.querySelectorAll('.js-product-keywords-holder')[0].children,
  14.         newKeywords = document.createElement("p"),
  15.         keys = document.querySelector(".product-page-keywords"),
  16.         parent = keys.parentNode;
  17.  
  18.     keywords = [...keywords].map(k => k.innerHTML).map(a => `<a href="/search/${a}">${a}</a>`);
  19.  
  20.     newKeywords.innerHTML = `${keywords.length} keywords:<br>${keywords.join(', ')}`;
  21.     newKeywords.style.cssText = 'padding-left: 14px; text-align: left; line-height: 150%';
  22.  
  23.     parent.appendChild(newKeywords);
  24.     parent.removeChild(keys);
  25. })();
RAW Paste Data
Top