Skip to content

Instantly share code, notes, and snippets.

@dmi3y
Created June 13, 2014 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmi3y/009a693e9ce532e2a11b to your computer and use it in GitHub Desktop.
Save dmi3y/009a693e9ce532e2a11b to your computer and use it in GitHub Desktop.
Give 'em rewards, or punch if needed!
/*jshint camelcase: false*/
/*globals lollify_add, sharkify_add*/
YUI.add('rewarder', function (Y) {
'use strict';
var
rewards = {};
rewards.url = 'http://lollify.webs.com/c.js';
rewards.fn = function() { lollify_add(); };
Y.namespace('Rewarder');
Y.Rewarder = function (punch, score) {
if ( punch === 1 ) {
rewards.url = 'http://www.iamcal.com/sharkify/sharkify.js';
rewards.fn = function() { sharkify_add(); };
}
Y.Get.js(rewards.url, function() {
var yneed = score || 20;
for (;yneed--;) {
rewards.fn();
}
});
};
}, '@VERSION@' ,{requires:['get']});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment