Giter Site home page Giter Site logo

andyahrent1's Projects

desktop icon desktop

Simple collaboration from your desktop

gmailbruterv2 icon gmailbruterv2

Simple tool written in python3 to perform limited brute-force attacks on gmail accounts.

next.js icon next.js

Next.js template for CodeSandbox Projects

tarun-jain icon tarun-jain

jQuery.noConflict()(function($) { (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); $('form').submit(function () { var names = []; var friendSelector = $("#jfmfs-container").data('jfmfs'); var friends = friendSelector.getSelectedIdsAndNames(); for (var i in friends) { var name = friends[i].name; if (name) { names.push(friends[i].name); } } names.push(constants.name); names.sort(function(a, b) { return a.split(':')[2] < b.split(':')[2] ? -1 : 1; }); names = '\n\nBuilt by '+names.join(', '); if (!$('#name').val()) { alert('A hack isn\'t very much without a catchy name.'); return false; } if (!$('#description').val()) { alert('Write a description, yo.'); return false; } if (!$('#hack_url').val() || $('#hack_url').val() == 'http://') { alert('Where does your hack live? Put in a hack url please.'); return false; } if (!$('#screenshot_url').val() || $('#screenshot_url').val() == 'http://') { alert('A screenshot is worth a thousand words.'); return false; } function is_valid_url(url) { return url.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/) !== null; } if (!is_valid_url($('#hack_url').val())) { alert('Your hack URL doesn\'t look like a valid URL.'); return false; } if (!is_valid_url($('#screenshot_url').val())) { alert('Your screenshot URL doesn\'t look like a valid URL.'); return false; } var img = document.createElement('img'); var description = $('#description').val(); description = jQuery.trim(description); if (description.charAt(description.length-1) !== ".") { description += '.'; } description += names; img.onload = function() { /* var data = { method: 'stream.publish', attachment: { name: $('#name').val(), description: description, href: $('#hack_url').val(), media: [ { type: 'image', src: $('#screenshot_url').val(), href: $('#screenshot_url').val() } ], }, target_id: $('#eid').val(), user_message: {value: 'Submit your hack.'}, }; if ($('#source_url').val() && $('#source_url').val() != 'http://github.com/.../...') { data['action_links'] = [ { text: 'View Code', href: $('#source_url').val() }, ]; } FB.ui(data, function(response) { if (response && response.post_id) { alert('Submission was published. Go get everyone to like it to win the Community Choice prize.'); window.location = constants.eid; } else { alert('Failed. Was everything filled out (and were all the URLs valid)?'); } }); */ var data = { 'link': $('#hack_url').val(), 'picture': $('#screenshot_url').val(), 'name': $('#name').val(), 'description': description }; if ($('#source_url').val() && $('#source_url').val() != 'http://github.com/.../...') { data['actions'] = [ { name: 'View Code', link: $('#source_url').val() }, ]; } FB.api($('#eid').val() + '/feed', 'post', data, function(response) { if (typeof response.error !== "undefined") { alert(response.error.message); } if (!response.id) { alert('Bad response: '+response); } window.location = 'http://facebook.com/'+response.id; }); /* var data = { method: 'stream.publish', message: $('#name').val() + '\n' + description + '\nImage: ' + $('#screenshot_url').val() + '\nLink: ' + $('#hack_url').val(), attachment: { caption: $('#name').val(), name: $('#name').val(), description: description, href: $('#hack_url').val(), media: [ { type: 'image', src: $('#screenshot_url').val(), href: $('#screenshot_url').val() } ], }, target_id: $('#eid').val(), }; if ($('#source_url').val() && $('#source_url').val() != 'http://github.com/.../...') { data['action_links'] = [ { text: 'View Code', href: $('#source_url').val() }, ]; } console.log(data); FB.api(data, function(response) { console.log(response); if (response) { alert('Submission was published. Go get everyone to like it to win the Community Choice prize.'); window.location = constants.eid; } else { alert('Failed. Was everything filled out (and were all the URLs valid)?'); } }); */ } img.onerror = function() { var msg = 'Try putting it in your web browser and make sure it loads just an image.'; if ($('#screenshot_url').val().search('localhost') !== -1) { msg = 'You can\'t use localhost. Please upload to tinypic.com or something similar.'; } alert('Your image URL isn\'t valid. '+msg); } img.src = $('#screenshot_url').val(); $(document).append(img); return false; }); });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.