Script F12 import ignore list từ voz cũ qua đây

Tối qua thấy có bác hỏi ignore list bên https://next.voz.vn/t/lam-sao-de-import-doglist-tu-ben-kia-qua-ben-nay.7069, rảnh nên ngồi viết script luôn chạy console luôn :D Code sẽ có lỗi vì có 1 số username đặc biệt, em chưa gặp nên chưa biết.

Bước 1: Log in vào voz cũ => bật đến ignore list https://forums.voz.vn/profile.php?do=ignorelist (ignore list em có mấy mạng thôi, mấy bác 100 1000 mạng có phân trang hay không thì em không rõ nha, lỗi thì báo lại ở đây).

Bước 2: F12 => Tab console, copy đoạn code này
Code:
var coll = document.getElementsByTagName("li");
var i;
var arr = [];
for(i = 1; i < coll.length; i++)
{
    var text = "'" + coll[i].innerText + "." + coll[i].id.replace("user","") + "'";
    arr.push(text);
}
arr.toString();

Kết quả sẽ thấy có cái list đỏ đỏ ở dưới như hình
1584694395767.png


Bước 3: Copy cái list đỏ đỏ đó.
Bước 4: Log in next voz. F12 => Tab console y như cũ, Copy đoạn code này (Nhớ thay đổi paste cái vừa copy ở bước 3 vào giữa [] ở đầu code, ví dụ ['abc.123', 'xyz.345'], Nhớ bỏ 2 dấu ngoặc kép ở đầu + cuối khi copy " ")
Code:
var arrIgnore = []; //Paste cái đoạn copy hồi nãy vào giữa []
var i;
var xmlHttp = new XMLHttpRequest();
function httpGet(theUrl)
{
    xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
    xmlHttp.send( null );
    return xmlHttp.responseText;
}
function httpPost(theUrl, postData)
{
    xmlHttp.open("POST", theUrl, true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xmlHttp.send(postData);
    return xmlHttp.responseText;
}

for(i = 0; i < arrIgnore.length; i++)
{
var urlGet = "https://next.voz.vn/u/" + arrIgnore[i];
var text = await httpGet(urlGet);
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(text, 'text/html');
var token = htmlDoc.documentElement.getAttribute("data-csrf");

var postData = "_xfRequestUri=/u/"+ arrIgnore[i] + "&_xfWithData=1&_xfToken=" + token + "&_xfResponseType=json"
var urlPost = "https://next.voz.vn/u/" + arrIgnore[i] + "/ignore";
var text2 = await httpPost(urlPost, postData);
}
alert("Xong");
1584694724335.png


Check ignore list mới nào :D
1584694773865.png
 
Back
Top