Last active
July 21, 2023 08:35
-
-
Save israel24961/d7350988a910afac3e553474b0475333 to your computer and use it in GitHub Desktop.
Número de empleos Infojobs por palabra clave - Number of infojobs jobs per keyword. Sequentially generated
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
##!/bin/sh | |
# | |
total_Infojobs() { | |
ntotal=$(jq -rn --arg x "$1" '$x|@uri' |xargs -I{} curl 'https://www.infojobs.net/webapp/offers/search?keyword='"{}"'&normalizedJobTitleIds=&provinceIds=&cityIds=&teleworkingIds=&categoryIds=&workdayIds=&educationIds=&segmentId=&contractTypeIds=&page=1&sortBy=PUBLICATION_DATE&onlyForeignCountry=false&countryIds=&sinceDate=ANY&subcategoryIds=' \ | |
-H 'authority: www.infojobs.net' \ | |
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8' \ | |
-H 'accept-language: en-US,en;q=0.9' \ | |
-H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"' \ | |
-H 'sec-ch-ua-mobile: ?0' \ | |
-H 'sec-ch-ua-platform: "LaRataDe2Patas"' \ | |
-H 'sec-fetch-dest: document' \ | |
-H 'sec-fetch-mode: navigate' \ | |
-H 'sec-fetch-site: none' \ | |
-H 'sec-fetch-user: ?1' \ | |
-H 'sec-gpc: 1' \ | |
-H 'upgrade-insecure-requests: 1' \ | |
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \ | |
--compressed -s | grep -i -o -P "totalelements\":.{0,10},"| head -n 1 | tr -d 'totalElements":,') | |
echo "$1:$ntotal" | |
} | |
#The cookies aren't mine, the query didn't go through without them, | |
#didn't give it too much thought, tho. | |
total_Indeed(){ | |
ntotal=$( jq -rn --arg x "$1" '$x|@uri' |xargs -I{} curl 'https://es.indeed.com/jobs?q='"{}"'&l=' \ | |
-H 'authority: es.indeed.com' \ | |
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8' \ | |
-H 'accept-language: en-US,en;q=0.6' \ | |
-H 'cookie: __cf_bm=6iY3F3nmq3HpxyBSHJdoeA82MtM5i3IokuuAHT670WQ-1689927187-0-AV1VBA3ImbIOk/h8SLWa7zj12nUzHNayQe7zg3zmA6zPbuXB/oZOcC+EiGVaNbpIMXe6BqimXc0RV/cKWdr/1PI=; _cfuvid=34hJJ8H97gTEXlzlnsoMdTDDLv41UAr0pkz._cyLgoA-1689927187278-0-604800000; CTK=1h5ro4uv5gb4r800; CSRF=Exy1NsX0B3FNXFn8gF31yrrgML5whyTq; CF_BOTS-179=1; INDEED_CSRF_TOKEN=hrIQJvWbZb7lAJz8EfL9BHDsgdKevXdv; LV="LA=1689927187:CV=1689927187:TS=1689927187"; hpnode=1; SURF=jfeyYrjqEqkikcNay01QuWzRy6a8izPc; indeed_rcc="LV:CTK:UD"; loctip=1; jaSerpCount=1; UD="LA=1689927190:CV=1689927190:TS=1689927190:SG=1a246dbd09dacfa46a9899c20e5bb6a7"; RQ="q=c%23&l=&ts=1689927190048"; ac=bpN+YCeeEe6SI2cWOM/bgA#bpPMgCeeEe6SI2cWOM/bgA; JSESSIONID=F1D26C23DDF8CD0953A87B99257F2699; PTK=tk=1h5ro51fpjv5d800&type=jobsearch&subtype=topsearch' \ | |
-H 'referer: https://es.indeed.com/jobs' \ | |
-H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"' \ | |
-H 'sec-ch-ua-mobile: ?0' \ | |
-H 'sec-ch-ua-platform: "Linux"' \ | |
-H 'sec-fetch-dest: document' \ | |
-H 'sec-fetch-mode: navigate' \ | |
-H 'sec-fetch-site: same-origin' \ | |
-H 'sec-fetch-user: ?1' \ | |
-H 'sec-gpc: 1' \ | |
-H 'upgrade-insecure-requests: 1' \ | |
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \ | |
-s --compressed | sed -n '7p'| sed -e 's/.*content="//' -e 's/empleos.*//') | |
echo "$1:$ntotal" | |
} | |
echo "Infojobs" | |
for arg in "$@"; do | |
printf "$(total_Infojobs $arg) vs " & #remove & for determinism | |
done | |
wait | |
printf "\b\b\b \nIndeed\n" | |
for arg in "$@"; do | |
printf "$(total_Indeed $arg) vs " & #remove & for determinism | |
done | |
wait | |
printf "\b\b\b \n" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sequential
![res](https://user-images.githubusercontent.com/30273787/255038986-3b5762e4-ca9c-439e-be1e-eb4bbd8bc899.gif)
Parallel
![2023-07-21_5xJul_015](https://user-images.githubusercontent.com/30273787/255039198-8bf33c6a-88ae-4e13-a43a-d4adaf0ed90f.png)