Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Promise = require('bluebird');
- var cheerio = require('cheerio');
- var bhttp = require('bhttp');
- var User = require('../user');
- var fs = require('fs');
- var shelljs = require('shelljs');
- var session = bhttp.session();
- var os = require('os');
- var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
- var pastValue;
- var UserAgent = require('../user-agent');
- // --------- DATABASE ---------
- var mongoose = require('mongoose');
- mongoose.connect('mongodb://127.0.0.1:27017/bongacash');
- var mongoDB = mongoose.connection;
- mongoDB.on('error', function (err) {
- //console.log('connection error:', err.message);
- });
- mongoDB.once('open', function callback () {
- //console.log("Connected to DB!");
- });
- var Schema = mongoose.Schema;
- var SignUp = new Schema({
- affiliate_id: { type: String, required: true },
- scheuld: { type: JSON, required: true },
- modified: { type: Date, default: Date.now }
- });
- var IP = new Schema({
- ip: { type: String, required: true },
- affiliate_id: { type: String, required: true },
- modified: { type: Date, default: Date.now }
- });
- var SignUpModel = mongoose.model('SignUp', SignUp);
- var IPModel = mongoose.model('IP', IP);
- module.exports.SignUpModel = SignUpModel;
- module.exports.IPModel = IPModel;
- function getDate(){
- var days = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
- var currentdate = new Date();
- var date = {
- day : days[currentdate.getDay()],
- date : currentdate.getDate(),
- month : (currentdate.getMonth()+1),
- year : currentdate.getFullYear(),
- hour : currentdate.getHours(),
- min : currentdate.getMinutes(),
- sec : currentdate.getSeconds()
- };
- for(var k in date){
- var temp = date[k]+"";
- if(temp.length < 2){
- temp = "0"+temp;
- }
- }
- return date;
- }
- // --------- CREATING NEW QUERY ---------
- function generateScheuld(affiliate_id, callback){
- var affiliate_idCheckQuery = { affiliate_id : affiliate_id };
- SignUpModel.findOne(affiliate_idCheckQuery, function(err, respond) {
- if (respond){
- console.log('['+os.hostname()+'] SCHEULD ALREADY EXISTS FOR ID '+affiliate_id);
- callback(true);
- }else{
- console.log('['+os.hostname()+'] CREATING SCHEULD FOR ID '+affiliate_id);
- var affiliate_idGenerateScheuld = new SignUpModel({
- affiliate_id: affiliate_id,
- scheuld: addScheuld()
- });
- affiliate_idGenerateScheuld.save(function (err) {
- if (err) {console.log(err)} else {}
- });
- callback(true);
- }
- });
- }
- function compareIP(ip, affiliate_id, callback){
- var ipCheckQuery = { ip : ip, affiliate_id : affiliate_id };
- IPModel.findOne(ipCheckQuery, function(err, respond) {
- if (respond){
- console.log('['+os.hostname()+'] DUPLICATED IP');
- callback(false);
- }else{
- var ipNewSaveQuery = new IPModel({
- ip: ip,
- affiliate_id: affiliate_id
- });
- ipNewSaveQuery.save(function (err) {
- if (err) {console.log(err)} else {}
- });
- callback({
- ip: ip,
- affiliate_id: affiliate_id
- });
- }
- });
- }
- // --------- DATABASE ---------
- function timestamp(){
- var currentdate = new Date();
- var timestamp = {};
- timestamp.day = currentdate.getDate();
- timestamp.month = currentdate.getMonth()+1;
- timestamp.year = currentdate.getFullYear();
- timestamp.hour = currentdate.getHours();
- timestamp.min = currentdate.getMinutes();
- timestamp.sec = currentdate.getSeconds();
- return timestamp;
- }
- function addScheuld(){
- var scheuld = {
- "sunday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "low",
- "05:00" : "low",
- "06:00" : "low",
- "07:00" : "low",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "monday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "low",
- "05:00" : "low",
- "06:00" : "low",
- "07:00" : "low",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "tuesday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "low",
- "05:00" : "low",
- "06:00" : "low",
- "07:00" : "low",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "wednesday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "low",
- "05:00" : "low",
- "06:00" : "low",
- "07:00" : "low",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "thursday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "low",
- "05:00" : "low",
- "06:00" : "low",
- "07:00" : "low",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "friday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "high",
- "05:00" : "high",
- "06:00" : "high",
- "07:00" : "high",
- "08:00" : "high",
- "09:00" : "middle",
- "10:00" : "middle",
- "11:00" : "middle",
- "12:00" : "middle",
- "13:00" : "middle",
- "14:00" : "high",
- "15:00" : "middle",
- "16:00" : "middle",
- "17:00" : "middle",
- "18:00" : "middle",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "high",
- "22:00" : "high",
- "23:00" : "high"
- },
- "saturday" : {
- "00:00" : "high",
- "01:00" : "high",
- "02:00" : "high",
- "03:00" : "high",
- "04:00" : "high",
- "05:00" : "high",
- "06:00" : "high",
- "07:00" : "high",
- "08:00" : "high",
- "09:00" : "high",
- "10:00" : "high",
- "11:00" : "high",
- "12:00" : "high",
- "13:00" : "high",
- "14:00" : "high",
- "15:00" : "high",
- "16:00" : "high",
- "17:00" : "high",
- "18:00" : "high",
- "19:00" : "high",
- "20:00" : "high",
- "21:00" : "middle",
- "22:00" : "middle",
- "23:00" : "middle"
- }
- };
- var low = 350;
- var middle = 450;
- var high = 600;
- for(var k in scheuld) {
- for(var i in scheuld[k]){
- scheuld[k][i] = [0, 2];
- // if(scheuld[k][i] == "low"){
- // scheuld[k][i] = [0, getRandomInt(0, low)];
- // }
- // if(scheuld[k][i] == "middle"){
- // scheuld[k][i] = [0, getRandomInt(low, middle)];
- // }
- // if(scheuld[k][i] == "high"){
- // scheuld[k][i] = [0, getRandomInt(middle, high)];
- // }
- }
- }
- return scheuld;
- }
- function getRandomInt(min, max) {
- return Math.floor(Math.random() * (max - min + 1)) + min;
- }
- function separate(str){
- var STR = str+"";
- var position = STR.length;
- for(var i = STR.length; i > 0; i--){
- if((position-3) == i){
- STR = STR.substr(0, i) + " " + STR.substr(i);
- position = position-3;
- }
- }
- return STR;
- }
- String.prototype.replaceAll = function(str1, str2, ignore){
- return this.replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&"),(ignore?"gi":"g")),(typeof(str2)=="string")?str2.replace(/\$/g,"$$$$"):str2);
- };
- Object.size = function(obj) {
- var size = 0, key;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) size++;
- }
- return size;
- };
- var VISIT=true;
- var frame = 0;
- // setInterval(function(){
- // console.log(frame);
- // frame++;
- // if(frame > 500){
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // console.log(' RESET ');
- // session = bhttp.session();
- // hma.close();
- // VISIT=true;
- // frame=0;
- // }
- // },100);
- function parseCookies(request) {
- var list = {},
- rc = request.headers.cookie;
- rc && rc.split(';').forEach(function( cookie ) {
- var parts = cookie.split('=');
- list[parts.shift().trim()] = decodeURI(parts.join('='));
- });
- return list;
- }
- function getAcceptLanguage(){
- var acceptLanguage = [
- "cs, en-us; 0.9, de-de; 0.8, ru-ru; 0.7",
- "en;q=1.0, en;q=0.5, zh-cn, zh;q=0.5, en;q=0.5",
- "en;q=1.0,fr;q=1.0,de;q=0.9,ja;q=0.9,nl",
- "ca,ca-ES,es-es;q=0.9,es;q=0.9,en-US",
- "en-us;q=1.0, es-ve;q=0.5",
- "en;q=0.9,es-419;q=0.8,ca-AD",
- "de;q=0.7,ca-CA;q=0.7,cs-CZ"
- ];
- return acceptLanguage[getRandomInt(0, acceptLanguage.length-1)];
- }
- var email = {
- status : "",
- create : function(email, callback){
- return Promise.try(function () {
- return session.get("http://mailnesia.com/mailbox/"+email);
- }).then(function (response) {
- callback(email);
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ email.create() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- });
- },
- getApproveURL : function(email, callback){
- return Promise.try(function () {
- return session.get("http://mailnesia.com/mailbox/"+email);
- }).then(function (response) {
- var $ = cheerio.load(response.body);
- var emailURL = "http://mailnesia.com"+$('a.email').attr('href');
- console.log('EMAIL URL: '+emailURL);
- return session.get(emailURL);
- }).then(function (response) {
- if (response) {
- var $ = cheerio.load(response.body);
- var approveURL = $('table.content').find('a').attr('href');
- callback(approveURL);
- }else{
- callback(false);
- }
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+email+'------------------ email.getApproveURL() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- });
- },
- approve : function(url, callback){
- return Promise.try(function () {
- return session.get(url);
- }).then(function (response) {
- session = bhttp.session();
- callback("OK");
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ email.approve() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- callback(false);
- });
- }
- };
- var bongacams = {
- username : "",
- getID : function(callback){
- var id = ["332521","332521","332521"];
- callback(id[getRandomInt(0, id.length-1)]);
- },
- visit : function(id, callback){
- return Promise.try(function () {
- return session.get("http://bongacams.com/track?c="+id);
- }).then(function(response) {
- if(response){
- callback(response);
- }
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ chaturbate.visit() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- callback(false);
- });
- },
- signup : function(id, ip, callback){
- return Promise.try(function () {
- return session.get("http://bongacams.com/track?c="+id);
- }).then(function(response) {
- if(response){
- frame=0;
- console.log('['+os.hostname()+'] '+'/track?c='+id);
- return session.get("https://bongacams.com/members/join");
- }
- }).then(function(response) {
- if(response){
- frame=0;
- console.log('['+os.hostname()+'] '+'Loaded URL: /members/join');
- var $ = cheerio.load(response.body);
- var meta = User.generate();
- meta.email = meta.username+"@mailnesia.com";
- var date = timestamp();
- var SLAI = '{' +
- '"language":"en",' +
- '"cookieEnabled":true,' +
- '"javaEnabled":false,' +
- '"dateTime":"'+date.day+'.'+date.month+'.'+date.year+', '+date.hour+':'+date.min+':'+date.sec+'",' +
- '"ips":["192.168.1.100","'+ip+'"]' +
- '}';
- console.log('['+os.hostname()+'] '+SLAI);
- bongacams.username = meta.username;
- email.create(meta.username, function(){});
- return session.post("https://bongacams.com/members/join", {
- "security_log_additional_info" : SLAI,
- "popup_signup_source_id" : "",
- "user_member[id]" : "",
- "user_member[current_performer]" : "",
- "user_member[username]" : meta.username,
- "user_member[email]" : meta.email,
- "user_member[fix_chrome_autocomplete]" : "",
- "user_member[password]" : meta.password,
- "user_member[promo_code]" : "",
- "user_member[terms_of_use]" : "on"
- }, {
- headers: {
- "origin": "https://bongacams.com",
- "referer": "https://bongacams.com/members/join",
- "user-agent": UserAgent.get(),
- "accept-language": getAcceptLanguage()
- }
- });
- }
- }).then(function(response){
- if(response){
- var username = bongacams.username;
- bongacams.username = "";
- frame=0;
- var $ = cheerio.load(response.body);
- var confirmation = $('div.confirm_email_box').text();
- //confirmation = (confirmation.html()+'').replace('\n', '');
- callback(username);
- //if(error == 'Congratulations! You are ready to Chat.'){
- // console.log('['+os.hostname()+'] '+'user "'+$('a.username').html()+'" registered');
- // session = bhttp.session();
- // hma.close();
- // VISIT=true;
- // frame=0;
- //}else{
- // VISIT=true;
- // session = bhttp.session();
- // hma.close();
- // frame=0;
- // console.log('['+os.hostname()+'] '+$('#main').html());
- // console.log('['+os.hostname()+'] '+$('#error_notice').html());
- //}
- }
- }).catch(function(err){
- callback(false);
- //frame=0;
- //VISIT=true;
- //session = bhttp.session();
- //hma.close();
- //status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ bongacams.signup() ERR ------------------');
- });
- }
- };
- var chaturbate = {
- status : "",
- getID : function(callback){
- // req('http://ft.camroutes.com/chaturbate/affiliate.nodejs', function(data){
- // var DATA = data.split(',');
- // var ID = [];
- // for(var i = 0; i < DATA.length; i++){
- // ID.push(DATA[i]);
- // }
- // status = ID;
- // //console.log('['+os.hostname()+'] '+'------------------ chaturbate.getID() OK ------------------');
- // //console.log('['+os.hostname()+'] '+JSON.stringify(status));
- // //console.log('['+os.hostname()+'] '+'---------------------------------------------------------------------------');
- // callback(ID);
- // });
- callback(["B64g1","B64g1"])
- },
- login : function(username, password) {
- return Promise.try(function () {
- return session.get("https://chaturbate.com/auth/login/");
- }).then(function (response) {
- var $ = cheerio.load(response.body);
- status = $(".requiredfield").text();
- var csrfToken = $("#main form[action='/auth/login/'] input[name='csrfmiddlewaretoken']").val();
- return session.post("https://chaturbate.com/auth/login/", {
- username: username,
- password: password,
- csrfmiddlewaretoken: csrfToken,
- next: "/"
- }, { headers: {"referer": "https://chaturbate.com/auth/login/"}});
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ chaturbate.login() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- });
- },
- visit : function(url){
- return Promise.try(function () {
- return session.get(url);
- }).catch(function(err) {
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ chaturbate.visit() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- });
- },
- signup : function(id, callback){
- return Promise.try(function () {
- return session.get("http://chaturbate.com/affiliates/in/?track=default&tour=g4pe&campaign="+id);
- //return session.get("http://chaturbate.com/affiliates/in/?track=default&tour=4uT2&campaign="+id);
- }).then(function(response) {
- if(response){
- frame=0;
- console.log('['+os.hostname()+'] '+'/in/?track=default&tour=g4pe&campaign='+id);
- //console.log('['+os.hostname()+'] '+'Loaded URL: /in/?track=default&tour=4uT2&campaign='+id);
- return session.get("https://chaturbate.com/accounts/register/");
- }
- }).then(function(response) {
- if(response){
- frame=0;
- console.log('['+os.hostname()+'] '+'Loaded URL: /accounts/register/');
- var $ = cheerio.load(response.body);
- var meta = User.generate();
- meta.birthday_day = getRandomInt(2, 31);
- meta.birthday_month = getRandomInt(2, 12);
- meta.birthday_year = getRandomInt(1989, 1994);
- //console.log('['+os.hostname()+'] '+meta);
- var csrfToken = $("#main form[action='/accounts/register/'] input[name='csrfmiddlewaretoken']").val();
- return session.post("https://chaturbate.com/accounts/register/", {
- username: meta.username,
- password: meta.password,
- email: meta.email,
- birthday_day: meta.birthday_day,
- birthday_month: meta.birthday_month,
- birthday_year: meta.birthday_year,
- gender: "f",
- studio: "",
- terms: "on",
- csrfmiddlewaretoken: csrfToken
- }, {
- headers: {
- "origin": "https://chaturbate.com",
- "referer": "https://chaturbate.com/accounts/register/",
- "user-agent": UserAgent.get(),
- "accept-language": getAcceptLanguage()
- }
- });
- }
- }).then(function(response) {
- if(response){
- frame=0;
- var $ = cheerio.load(response.body);
- var error = $('div.top-section').find('h1');
- error = (error.html()+'').replace('\n', '');
- if(error == 'Congratulations! You are ready to Chat.'){
- console.log('['+os.hostname()+'] '+'user "'+$('a.username').html()+'" registered');
- session = bhttp.session();
- hma.close();
- VISIT=true;
- frame=0;
- }else{
- VISIT=true;
- session = bhttp.session();
- hma.close();
- frame=0;
- console.log('['+os.hostname()+'] '+$('#main').html());
- console.log('['+os.hostname()+'] '+$('#error_notice').html());
- }
- }
- }).catch(function(err) {
- frame=0;
- VISIT=true;
- session = bhttp.session();
- hma.close();
- status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ chaturbate.signup() ERR ------------------');
- console.log('['+os.hostname()+'] '+status);
- });
- }
- };
- var hma = {
- connect : function(){
- shelljs.exec('./hma/connect.sh', {async:true});
- },
- close : function(){
- console.log('['+os.hostname()+'] '+'-------------------------------------');
- shelljs.exec('./hma/close.sh', {async:true});
- },
- status : function(callback){
- fs.readFile('./hma/status.log', 'utf8', function (err, data) {
- if (err) {
- fs.writeFile('./hma/status.log', 'disconnected', function(err) {
- if(err){}else{callback('disconnected');}
- });
- }else{
- callback(data);
- }
- });
- }
- };
- var ip = {
- get : function(callback){
- req("https://api.ipify.org", function(res) {
- if (res) {
- callback(res);
- } else {
- callback(false);
- }
- });
- },
- check : function(){},
- compare : function(){}
- };
- function req(url, callback) {
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) { //if complete
- if (xhr.status === 200) { //check if "OK" (200)
- callback(xhr.responseText);
- } else {
- callback(false);
- }
- }
- };
- try {
- xhr.open("GET", url, true);
- xhr.send();
- } catch (error) {
- callback(false);
- }
- }
- var accounts = [];
- var statisticsAll = {};
- var statistics = {};
- var count = 0;
- var timeout;
- hma.close();
- function start(){
- Promise.try(function() {
- // Проверяем статус VPN
- hma.status(function(status){
- if(typeof status != 'undefined'){
- status = status.replace('\n', '');
- console.log('['+os.hostname()+'] '+status);
- if(status == 'connected'){
- if(VISIT) {
- VISIT = false;
- ip.get(function(ip){
- if(ip){
- frame=0;
- console.log('['+os.hostname()+'] '+'Your current IP: '+ip);
- chaturbate.getID(function (ID) {
- if (ID) {
- var id = ID[getRandomInt(0, ID.length - 1)];
- console.log('['+os.hostname()+'] '+'Current ID: ' + id);
- chaturbate.signup(id);
- }
- });
- }
- })
- }
- }
- if(status == 'trying'){
- }
- if(status == 'disconnected'){
- hma.connect();
- }
- }
- });
- }).then(function () {
- clearTimeout(timeout);
- timeout = setTimeout(function(){
- start();
- }, 3000);
- }).catch(function(err) {
- chaturbate.status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ mainLoop ------------------');
- console.log('['+os.hostname()+'] '+chaturbate.status);
- });
- }
- //start();
- function bongacashViews(){
- Promise.try(function() {
- // Проверяем статус VPN
- hma.status(function(status){
- if(typeof status != 'undefined'){
- status = status.replace('\n', '');
- console.log('['+os.hostname()+'] '+status);
- if(status == 'connected'){
- if(VISIT) {
- VISIT = false;
- ip.get(function(ip){
- if(ip){
- frame=0;
- console.log('['+os.hostname()+'] '+'Your current IP: '+ip);
- bongacams.getID(function(id){
- console.log('['+os.hostname()+'] id: '+id);
- bongacams.visit(id, function(response){
- if(response){
- console.log('['+os.hostname()+'] URL visit: OK!');
- setTimeout(function(){
- console.log('['+os.hostname()+'] URL visit: TRYING ...');
- session = bhttp.session();
- hma.close();
- VISIT=true;
- frame=0;
- bongacashViews();
- }, 25000);
- }else{
- console.log('['+os.hostname()+'] URL visit: OK!');
- setTimeout(function(){
- console.log('['+os.hostname()+'] URL visit: TRYING ...');
- session = bhttp.session();
- hma.close();
- VISIT=true;
- frame=0;
- bongacashViews();
- }, 25000);
- }
- });
- });
- }
- })
- }
- }
- if(status == 'trying'){
- }
- if(status == 'disconnected'){
- hma.connect();
- }
- }
- });
- }).then(function () {
- clearTimeout(timeout);
- timeout = setTimeout(function(){
- session = bhttp.session();
- hma.close();
- VISIT=true;
- frame=0;
- bongacashViews();
- }, 25000);
- }).catch(function(err) {
- chaturbate.status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ mainLoop ------------------');
- console.log('['+os.hostname()+'] '+chaturbate.status);
- });
- }
- //bongacashViews();
- var oneHalfHour = false;
- var twoHalfHour = false;
- var lastHour;
- function scheuldChecker(callback){
- var time = timestamp();
- if(oneHalfHour == false && twoHalfHour == false){
- console.log('Save Current Hour!');
- lastHour = time.hour;
- }
- if(lastHour != time.hour){
- console.log('New Hour Begin!');
- oneHalfHour = false;
- twoHalfHour = false;
- lastHour = time.hour;
- }
- if(oneHalfHour == false && parseInt(time.min) < parseInt(30)){
- oneHalfHour = true;
- console.log('First Registration DONE!');
- callback(true);
- }
- if(twoHalfHour == false && parseInt(time.min) > parseInt(30)){
- twoHalfHour = true;
- console.log('Second Registration DONE!');
- callback(true);
- }
- if(oneHalfHour == true){
- var wait = 30-time.min;
- console.log('Next registration after '+wait+' min.');
- }
- if(twoHalfHour == true){
- var wait = 60-time.min;
- console.log('Next registration after '+wait+' min.');
- }
- }
- function bongacashStart(){
- bongacams.getID(function(id){
- //generateScheuld(id, function(respond){
- // if(respond){
- scheuldChecker(function(result){
- if(result){
- ip.get(function(ip){
- compareIP(ip, id, function(respond){
- if(respond){
- console.log('['+os.hostname()+'] SIGN UP DONE! - ip: '+ip+' id: '+id);
- }
- });
- });
- }
- });
- // bongacams.visit(id, function(response){
- // if(response){
- // console.log('['+os.hostname()+'] URL visit: OK!');
- // setTimeout(function(){
- // console.log('['+os.hostname()+'] URL visit: TRYING ...');
- // bongacashStart();
- // }, 25000);
- // }else{
- // console.log('['+os.hostname()+'] URL visit: OK!');
- // setTimeout(function(){
- // console.log('['+os.hostname()+'] URL visit: TRYING ...');
- // bongacashStart();
- // }, 25000);
- // }
- // });
- // bongacams.signup(id, ip, function(response){
- // if(response){
- // console.log('['+os.hostname()+'] '+response);
- // setTimeout(function(){
- // email.getApproveURL(response, function(url){
- // if(typeof url != "undefined" && url != false){
- // console.log('['+os.hostname()+'] '+url);
- // email.approve(url, function(url){
- // console.log('['+os.hostname()+'] '+url);
- // setTimeout(function(){
- // console.log('['+os.hostname()+'] ----------------------');
- // //bongacashStart();
- // }, 5000);
- // });
- // }else{
- // email.getApproveURL(response);
- // }
- // });
- // }, 45000);
- // }else{
- // console.log('['+os.hostname()+'] ----------------------');
- // //bongacashStart();
- // }
- // });
- // }
- //});
- });
- }
- setInterval(function(){
- bongacashStart();
- }, 2000);
- //bongacashStart();
- //email.getApproveURL("motherfuckermickeybitch", function(response){
- // if(response){
- // console.log(response);
- // email.approve(response, function(username){
- // console.log(username);
- // });
- // }
- //});
- //email.create("motherfuckermickeybitch", function(response){
- // if(response){
- // console.log(response);
- // }
- //});
- // MainLoop DONT USE
- var mainLoop = function () {
- chaturbate.getID(function(ID){
- if(ID){
- Promise.try(function () {
- sh.connect();
- sh.close();
- return ID[getRandomInt(0, ID.length-1)];
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- return id;
- }).then(function (id) {
- console.log('['+os.hostname()+'] '+id)
- // if(response.error){
- // console.log('['+os.hostname()+'] '+"ERR");
- // session = bhttp.session();
- // }else{
- // var $ = cheerio.load(response.body);
- // chaturbate.status = $('.username').html();
- // console.log('['+os.hostname()+'] '+'------------------ chaturbate.login() OK ------------------');
- // console.log('['+os.hostname()+'] '+chaturbate.status);
- // console.log('['+os.hostname()+'] '+'---------------------------------------------------------------------------');
- // }
- }).then(function () {
- clearTimeout(timeout);
- timeout = setTimeout(function(){
- mainLoop();
- }, 1500);
- }).catch(function(err) {
- chaturbate.status = 'error:'+err;
- console.log('['+os.hostname()+'] '+'------------------ mainLoop ------------------');
- console.log('['+os.hostname()+'] '+chaturbate.status);
- });
- }
- });
- };
- // MainLoop DONT USE
- var cub = function(io) {
- //io.on('connection', function(socket){
- // console.log('['+os.hostname()+'] '+'a user connected');
- // var sender = setInterval(function(){
- // socket.emit('statistics', statisticsAll);
- // socket.emit('status', true);
- // }, 1000);
- // socket.on('authorization', function(data){
- // if(data == '1488'){
- // socket.emit('authorization', 'ok');
- // }
- // });
- // socket.on('disconnect', function(){
- // clearInterval(sender);
- // console.log('['+os.hostname()+'] '+'user disconnected');
- // });
- //});
- };
- module.exports.cub = cub;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement