Created
November 11, 2012 17:03
-
-
Save XORwell/4055523 to your computer and use it in GitHub Desktop.
domino-doc-grabber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name domino-doc-grabber | |
// @description grab methodnames from documentation | |
// @namespace domino-doc-grabber | |
// @version 0.0.1 | |
// @include http*://publib.boulder.ibm.com/* | |
// @require http://code.jquery.com/jquery-1.8.2.min.js | |
// ==/UserScript== | |
/** | |
* requirements: Tampermonkey | |
* usage: | |
* 1. tap with your mouse into the frame where the links should be grabbed | |
* 2. press 'g' | |
* 3. copy console output | |
* | |
* example url: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_NOTESACL_CLASS_JAVA.html | |
**/ | |
$(document).keypress(function(event) { | |
//grep if 'g' (charCode 103) is pressed | |
if(event.charCode == 103){ | |
properties = [] | |
methods = [] | |
$('a[href*="PROPERTY"]').each(function(index){ | |
if ($(this).text().split(' ').length > 1){ | |
console.log('WARNING WHITESPACE (skipped): '+$(this).text()); | |
} else { | |
properties.push($(this).text()); | |
} | |
}); | |
$('a[href*="METHOD"]').each(function(index){ | |
if ($(this).text().split(' ').length > 1){ | |
console.log('WARNING WHITESPACE (skipped): '+$(this).text()); | |
} else { | |
methods.push($(this).text()); | |
} | |
}); | |
console.log("Methods:", methods); | |
console.log("Properties:", properties); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment