dafi
1/30/2011 - 7:03 AM

Press F2 to add the current google reader entry title to tags

Press F2 to add the current google reader entry title to tags

/**
 * Author: Davide Ficano https://github.com/dafi
 * Greader Auto Tagger from current entry title
 * While you are on google reader press F2, the tag input box will open containing the
 * current tags for current entry plus the title
 */
javascript:window.addEventListener('keydown', function(event) {
    // F2 key
    var isValidKey = event.keyCode == 113;
    if (!isValidKey) {
        return;
    }
    var currentEntry = document.getElementById('current-entry');
    var title = document.querySelector('#current-entry .entry-title-link').firstChild.nodeValue;
    var tag = document.querySelector('#current-entry .entry-tagging-action-title');
    var evt = document.createEvent("MouseEvents");
    evt.initMouseEvent("click", true, true, window,
                        0, 0, 0, 0, 0, false, false, false, false, 0, null);
    tag.dispatchEvent(evt);
    setTimeout(function() {
        document.querySelector('.tags-edit-tags').value += title;
    }, 10);
}, true);