Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name live autoreg
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://www.msn.com/*
- // @include https://*.live.com/*
- // @require http://code.jquery.com/jquery-latest.js
- // @grant GM_xmlhttpRequest
- // ==/UserScript==
- var page = location.pathname;
- var host = location.hostname;
- (function ($, undefined) {
- $(function () {
- var hCondition = (!host.includes('live.com')) ? msnClick() : signUp();
- function signUp() {
- if (page.includes('login.srf')) {
- $('a').each(function() {
- if (this.getAttribute('id') == 'signup') this.click();
- });
- }
- if (document.body.innerHTML.includes('Create an account')) {
- GM_xmlhttpRequest({
- method: "GET",
- url: "http://ask.fm/",
- onload: function(response) {
- var doc = new DOMParser().parseFromString(response.responseText, 'text/html');
- var imgs = doc.getElementsByTagName('img');
- for (var i = 0; i < imgs.length; i++) {
- var tImg = imgs[i];
- if (tImg.src.includes('/thumb/')) {
- var uname = tImg.getAttribute('alt') + jrand(1, 9999);
- var name = tImg.getAttribute('alt');
- var lname = tImg.getAttribute('alt');
- var pass = Math.random().toString(36).substring(jrand(16, 20));
- var inter = setInterval(function() {
- if (typeof $('#pageDialogForm_0') != 'undefined') {
- fillForms(uname, name, lname, pass);
- clearInterval(inter);
- }
- }, 100);
- break;
- }
- }
- }
- });
- }
- }
- function fillForms(uname, name, lname, pass) {
- document.getElementsByTagName('a')[3].click();
- $('input').each(function() {
- var tId = this.getAttribute('id');
- switch (tId) {
- case 'FirstName':
- this.value = uname;
- this.setAttribute('class', 'form-control');
- break;
- case 'LastName':
- break;
- case 'MemberName':
- break;
- case 'Password':
- break;
- case 'RetypePassword':
- break;
- case 'iAltEmail':
- break;
- }
- document.getElementsByTagName('input')[14].focus();
- });
- $('select').each(function() {
- var id = this.getAttribute('id');
- switch(id) {
- case 'BirthMonth':
- break;
- case 'BirthDay':
- break;
- case 'BirthYear':
- break;
- case 'Gender':
- break;
- }
- });
- }
- function msnClick() {
- if (page == '/') {
- $('span').each(function() {
- if (this.getAttribute('class') == 'mectrlname mectrlsignin') this.click();
- });
- }
- }
- function jrand(min, max) {
- return Math.floor(Math.random() * (max - min + 1)) + min;
- }
- });
- })(window.jQuery.noConflict(true));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement