This file contains hidden or 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
/* Paste this in the JS console on the amazon "improve your recommendations" page. | |
It finds all the "don't use this item" checkboxes, and clicks them if they are not checked. | |
Finally it waits a few seconds for the XHR to complete, then loads the next page. | |
Of course this will all break when Amazon changes their page layout, but it shouldn't be too hard to fix. | |
*/ | |
(function() { | |
var cb = document.querySelectorAll('[type=checkbox]'); | |
for (var i = 0 ; i < cb.length ; i++) { | |
if (cb[i].parentElement.parentElement.id.startsWith("cb_isExcluded")) { | |
if (cb[i].checked === false) { |
This file contains hidden or 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
/** | |
* Use reflection to shallow copy simple type fields with matching names from one object to another | |
* @param fromObj the object to copy from | |
* @param toObj the object to copy to | |
*/ | |
public static void copyMatchingFields( Object fromObj, Object toObj ) { | |
if ( fromObj == null || toObj == null ) | |
throw new NullPointerException("Source and destination objects must be non-null"); | |
Class fromClass = fromObj.getClass(); |