This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const cheerio = require('cheerio'); | |
async function cheerioExample() { | |
const pageContent = await axios.get('https://slides.com/carboleda'); | |
const $ = cheerio.load(pageContent.data); | |
const presentations = $('li.deck.public').map((_, el) => { | |
el = $(el); | |
const title = el.find('span.deck-title-value').text(); | |
const description = el.find('span.deck-description-value').text(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="presentations"> | |
<ul class="decks visible" data-tab-id="personal"> | |
<li class="deck public"> | |
<a class="deck-link" href="/carboleda/remote-work"></a> | |
<h2 class="deck-title"> | |
<span class="deck-title-value ">Trabajo remoto</span> | |
</h2> | |
<p class="deck-description"> | |
<span class="deck-description-value ">En esta presentación compartiré...</span> | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scrapeIt = require("scrape-it"); | |
async function scrapeItExample() { | |
const scrapeResult = await scrapeIt('https://slides.com/carboleda', { | |
presentations: { | |
listItem: 'li.deck.public', | |
data: { | |
title: 'span.deck-title-value', | |
description: 'span.deck-description-value', | |
link: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extract comments by user in Streamyard | |
var nickComments = {}; | |
document | |
.querySelectorAll('.PlatformCommentList__List-dYPHyO.jgefvQ li span.lhUFXI') | |
.forEach(el => { | |
var nick = el.innerText; | |
if (!nickComments[nick]) nickComments[nick] = 0; | |
nickComments[nick] += 1; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { docker { image 'node:18.7-alpine' } } | |
stages { | |
stage('test') { | |
steps { | |
sh 'npm run test:ci' | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"test": "node --expose-gc ./node_modules/.bin/jest --runInBand --logHeapUsage", | |
} | |
} |
OlderNewer