function getFkey(res) { const dom = parse(res) return dom.querySelectorAll('input').find(i => i.rawAttributes.name === 'fkey').rawAttributes.value }
root.querySelectorAll('a').filter(a => a.rawAttributes.hasOwnProperty('rel'))
entities.decode(root.querySelector('.quote').childNodes.filter(node => !node.rawAttributes || !node.rawAttributes.hasOwnProperty('rel')).map(node => node.rawText).join('').replace(/\n/g, ' ').replace('—', ''))
async function loadRooms(domain, page = 1) { if (!domainVars.doneWithRooms.hasOwnProperty(domain)) { domainVars.doneWithRooms[domain] = false } if (domainVars.doneWithRooms[domain]) return const res = await request(`https://chat.${domain}.com/?tab=all&sort=active&page=${page}`) const root = parse(res) const rooms = root.querySelectorAll('.roomcard').map(room => ({ id: +room.querySelector('.room-name a').rawAttributes.href.replace(/\/rooms\/(\d+)\/(?:.+)?/, '$1'), name: room.querySelector('span.room-name').attributes.title, users: +room.querySelector('.room-users').rawAttributes.title.replace(/ users? present/, '') })) if (!domainVars.rooms.hasOwnProperty(domain)) { domainVars.rooms[domain] = {} } const newRooms = rooms .filter(room => !domainVars.rooms[domain].hasOwnProperty(room.id)) domainVars.doneWithRooms[domain] = newRooms.length === 0 newRooms .forEach(room => domainVars.rooms[domain][room.id] = room) return newRooms }
root.querySelectorAll('.ob-post-tags .ob-post-tag').map(tag => tag.rawText)