Greasy Fork

Goodreads giveaway auto-enter

Auto-enter giveaway

当前为 2016-07-28 提交的版本,查看 最新版本

// ==UserScript==
// @name         Goodreads giveaway auto-enter
// @namespace    http://ttmyller.azurewebsites.net/
// @version      0.1
// @description  Auto-enter giveaway
// @author       ttmyller
// @include      https://www.goodreads.com/giveaway/enter*
// @include      http://www.goodreads.com/giveaway/enter*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==

// Change this to false if you want always click the last submit button manually
var autoSubmit = true;

// Select (first) address if needed
clickFirst("a:contains('Select This Address')");

// Check "I agree to sell my soul to satan" checkbox
clickFirst("#termsCheckBox");

// Uncheck the "add in to-read shelf"
clickFirst("#want_to_read");

if (autoSubmit)
    clickFirst("#giveawaySubmitButton")

function clickFirst(selector) {
    var el = $(selector);
    if (el.length > 0) {
        el[0].click();
    }
}