16 lines
574 B
JavaScript
16 lines
574 B
JavaScript
function getChats() {
|
|
let chats = [];
|
|
document.querySelectorAll('._2EXPL').forEach(chat => {
|
|
const c = {
|
|
profilePic: chat.querySelector('img') ? chat.querySelector('img').src : '',
|
|
name: chat.querySelector('._1wjpf').textContent,
|
|
message: chat.querySelector('._2_LEW ').textContent,
|
|
time: chat.querySelector('._3T2VG').textContent,
|
|
unreadMessages: false, // TODO unreadMessages
|
|
unreadCount: 0, // TODO unreadCount
|
|
}
|
|
chats.push(c);
|
|
})
|
|
return chats;
|
|
}
|
|
getChats()
|