Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function startImporter(data) {
- var index = 0;
- totalCount = data.users.length;
- $("#blockchain-dialog .totalCount").text(totalCount);
- blockerInterval = setInterval(function() {
- for(var i = 0; i < batchBlockCount && index < data.users.length; i++) {
- var user = data.users[index];
- if (typeof user !== "undefined") {
- doBlock($("#signout-form input.authenticity_token").val(), user.id, user.name);
- }
- index++;
- }
- });
- }
- function doBlock(authenticity_token, user_id, user_name, callback) {
- $.ajax({
- url: "https://twitter.com/i/user/block",
- method: "POST",
- dataType: 'json',
- data: {
- authenticity_token: authenticity_token,
- block_user: true,
- impression_id: "",
- report_type: "",
- screen_name: user_name,
- user_id: String(user_id)
- }
- }).done(function(response) {
- //console.log(response);
- queuedStorage[user_name] = {type: connectionType, connection: currentProfileName, on: Date.now(), id: String(user_id)};
- }).fail(function(xhr, text, err) {
- errors++;
- $("#blockchain-dialog .errorCount").text(errors);
- //console.log(xhr);
- }).always(function() {
- usersBlocked++;
- $("#blockchain-dialog .usersBlocked").text(usersBlocked);
- if ((
- usersBlocked == totalCount
- || usersBlocked == usersFound
- || (mode == 'import' && usersBlocked + errors >= totalCount && totalCount > 0)
- ) && totalCount > 0 && !finderRunning) {
- clearInterval(blockerInterval);
- blockerInterval = false;
- saveBlockingReceipts();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment