Created
January 8, 2022 20:49
-
-
Save sjpuas/b1a9f065220fc2376c5d6dcf087d1520 to your computer and use it in GitHub Desktop.
This file contains 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
/** to use in https://iniciativas.chileconvencion.cl/m/iniciativa_popular/# **/ | |
let propuestas = []; | |
$("#iniciativas>.card").each((i,e) => { | |
let propuesta = { | |
textId: $(e).children("h2").text().trim(), | |
title: $(e).children("h1").text().trim(), | |
text: $(e).children("p").text().trim(), | |
votes: $(e).data("apoyos") | |
}; | |
propuestas.push(propuesta); | |
}); | |
propuestas = propuestas.sort((a,b) => b.votes - a.votes ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment