I hereby claim:
- I am ntkog on github.
- I am ntkog (https://keybase.io/ntkog) on keybase.
- I have a public key ASCJCwrSDSTmbpY1fbLUJbV-v2zM2buBDM5J0EUjCoyujQo
To claim this, I am signing this object:
mkdir entidades_json | |
parallel -j+0 --eta --delay 1 --retries 3 --joblog parallel.log ./igae.sh {} "entidades_json/{}.json" :::: <(cat ids.txt) |
parallel -j+0 --eta curl -sSLk -o "files/issues_{}.json" "https://api.github.com/repos/JaimeObregon/observatoriospublicos.es/issues?page={}&q=is%3Aissue+is%3Aopen" :::: <(seq 1 6) | |
cat *.json | jq -s 'add' - > all_issues.json |
function covid19 () { | |
# Descargar informe | |
curl -sS -k $1 -O | |
PDF_FILENAME=`echo "$1" | cut -d'/' -f 10` | |
CSV_FILENAME=`echo $PDF_FILENAME | sed -r 's/\.pdf//'` | |
NOW=`date +%d_%m_%Y_%Hh` | |
# Convertir a texto | |
pdftotext -f 1 -l 1 -layout ${PDF_FILENAME} | |
# Convertir a CSV |
I hereby claim:
To claim this, I am signing this object:
{ | |
"version": 2, | |
"builds": [{ "src": "server.js", "use": "@now/node-server" }], | |
"routes": [ | |
{ | |
"src": "/", | |
"dest": "/server.js", | |
"methods": ["GET"] | |
} | |
] |
const puppeteer = require('puppeteer'); | |
const {writeFile} = require('jsonfile'); | |
const TWITTER_USER = process.argv[2] || "congosto"; | |
const TWEETS_TO_FETCH = process.argv[3] || 100; | |
function extractItems() { | |
return [...document.querySelectorAll('.tweet')] | |
.map(el => ({ | |
metadata : {...el.dataset}, |
parallel --dry-run --colsep '#' curl "{1}" -o {2}.mp3 :::: <(curl -sS "https://fapi-top.prisasd.com/podcast/playser/1_playser/itunes/la_ventana_mas_platon_y_menos_whatsapp/audios.xml" | xml2js | fx '.rss.channel.item.map(({title,enclosure,...rest}) => ({ title : /[|-]/.test(title) ? title.split(/[|-]/)[1].trim() : title, url : enclosure["@_url"]})).map(({title,url}) => ({ title : title.replace(/('|"|")/g, ""), url : url}))' | jq -r '.[] | (.url) + "#" + (.title)') |
cd data/countries | |
time parallel -j+0 curl -sS -o '{}.json' '"https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/World__Countries_Generalized_analysis_trim/FeatureServer/0/query?where=ISO_3DIGIT+%3D+%27{}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=ISO_3DIGIT&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=geojson&token="' :::: <(cat list.txt) |
function propuestas(partido) { | |
let lista = [...document.querySelectorAll('.e-module div[data-option]')].map(el=>({ | |
partido: el.dataset.option, | |
texto: [...el.querySelectorAll('p')].reduce((old,cur)=>old + cur.textContent, "") | |
})).filter(obj=> (partido === "all" ? true : obj.partido === partido) && obj.texto.length > 0); | |
partido === "all" ? console.table(lista) : console.table(lista,["texto"]); | |
let csv = lista.map(r => `"${r.partido}"|"${r.texto.replace(/\n/g, " ")}"`); | |
csv.unshift(`"partido"|"texto"`); | |
// Copia al portapapeles todos los datos a un CSV |
// Carga esta url | |
// https://presupuestosabiertos.madrid.es/es/inversiones/213/puente-de-vallecas#year=2017 | |
// Expande todos los conceptos | |
[...document.querySelectorAll('tr > td >a.toggle')].map( el => el.click() ) | |
// Resalta en amarillo todos los conceptos cuya ejecución presupuestaria es 0 | |
[...document.querySelectorAll('td:nth-child(3)')].filter(el => el.textContent === "0 €").map( el => el.style.backgroundColor = "yellow" ) |