Posted 3 years ago
·
Author
Hello
As i mentionned somewhere else, i made a script that can be used to compare the subscribers of two accounts, you simply copy/paste the code snippet in your browser console while being and on an imvu domain ( imvu classic website or imvu next is fine ) and it's going to retrieve both account subscribers, compare them and outputs the ones in common in the console. you also need to be logged in to imvu in your browser for it to work
simply replace the const name1 and name2 values by the wanted avatar names or customer id before clicking enter in your console
EG:
const name1 = 'someUser';
const name2 = 'someUser2';
If you have any questions, feel free to ask
Enjoy !
As i mentionned somewhere else, i made a script that can be used to compare the subscribers of two accounts, you simply copy/paste the code snippet in your browser console while being and on an imvu domain ( imvu classic website or imvu next is fine ) and it's going to retrieve both account subscribers, compare them and outputs the ones in common in the console. you also need to be logged in to imvu in your browser for it to work
simply replace the const name1 and name2 values by the wanted avatar names or customer id before clicking enter in your console
EG:
const name1 = 'someUser';
const name2 = 'someUser2';
const name1 = 'First Avatar name or customer id here';
const name2 = 'Second Avatar name or customer id here';
const getCid = (name) => {
return fetch(`https://api.imvu.com/user?username=${name}`, { "credentials": "include" })
.then(response => response.json())
.then(data => {
return Object.entries(data.denormalized)[0][1].data.legacy_cid
});
}
const getRequest = async(url) => {
let data = await (await (fetch(url)
.then(res => {
return res.json()
})
.catch(err => {
console.log('Error: ', err)
})
))
return data
}
const getNames = (json) => {
keys = Object.keys(json.denormalized);
const followersName = [];
keys.map(x => {
if (json.denormalized[x].data.avatar_name) {
followersName.push(json.denormalized[x].data.avatar_name);
}
});
return followersName;
}
const getNamesInCommon = (array1, array2) => {
return array1.filter(value => array2.includes(value))
}
const contactapi = async(cid1, cid2) => {
json1 = await getRequest(`https://api.imvu.com/profile/profile-user-${cid1}/subscribers?limit=50000`);
json2 = await getRequest(`https://api.imvu.com/profile/profile-user-${cid2}/subscribers?limit=50000`);
return [json1, json2];
};
const handleSubmit = async(cid1,cid2) => {
const t = await contactapi(cid1,cid2);
names1 = getNames(t[0]);
names2 = getNames(t[1]);
const common = getNamesInCommon(names1, names2);
console.log('name in common:', common);
}
(async() => {
let cid1 = name1;
let cid2 = name2;
if (isNaN(cid1)) {
cid1 = await getCid(cid1);
}
if (isNaN(cid2)) {
cid2 = await getCid(cid2);
}
await handleSubmit(cid1,cid2);
})();
If you have any questions, feel free to ask
Enjoy !
Last edited by pepsicolaa on Fri Jul 09, 2021 7:49 am, edited 2 times in total.