Skip to content

Instantly share code, notes, and snippets.

@astroza
Last active August 17, 2017 21:17
Show Gist options
  • Save astroza/ff89cc940b33ad9319bf3ae8ae6da641 to your computer and use it in GitHub Desktop.
Save astroza/ff89cc940b33ad9319bf3ae8ae6da641 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Autoclip
// @namespace http://nedmedia.io
// @version 0.1
// @description try to take over the world!
// @author F
// @update https://gist.github.com/astroza/ff89cc940b33ad9319bf3ae8ae6da641/raw/17f3e11fda0f4c7831bc232870c4971165f9bf42/autoclip-wordpress.user.js
// @match http://*/wp/wp-admin/post.php?post=*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function $x(xpath) {
return document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null );
}
var category = `programas-podcasts>${$x('//*[@id="programas-podcastschecklist"]//input[@checked="checked"]').iterateNext().value}>${$x('//*[@id="_thumbnail_id"]').iterateNext().value}`;
var update = document.getElementsByClassName('update-nag')[0];
update.innerHTML = `<h3>Autoclip Reference ID: ${category}</h3>` + update.innerHTML;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment