UNPKG

ipbcrawler

Version:

Package to mine forum data using the Invision Power Board platform.

52 lines (45 loc) 1.27 kB
const { accessElementInformation, sendElementToAccessInformation, asyncAccessElementInformation } = require('./../utils/extractor-access-element-information') const clear = require('./../utils/clear')(["[E]",]) const he = require('he') /** * [description] * @param {[type]} (element, $ [description] * @return {[type]} [description] */ const accessPostInformation = accessElementInformation((element, $) => { /** * [postElement description] * @type {[type]} */ const postElement = element.find('.ipsType_normal.ipsType_richText.ipsContained') /** * */ $(postElement).find('span.ipsType_reset').remove() return { /** * [post description] * @type {[type]} */ post: he.decode(element.find('.ipsType_normal.ipsType_richText.ipsContained').html()), /** * [author description] * @type {[type]} */ author: element.find('h3 strong a').text() } }) module.exports = ($) => { return { /** * [title description] * @type {[type]} */ title: $('h1.ipsType_pageTitle span.ipsType_break.ipsContained span').text(), /** * [post description] * @type {[type]} */ ...accessPostInformation($)($('.cPost.ipsBox.ipsComment')[0]) } }