source: https://github.com/b3n-j4m1n/salary-seeker
see it in action - https://github.com/b3n-j4m1n/salary-seeker/raw/master/demo.gif
It's a bash script, so you need a Unix-like OS, or something like Cygwin for Windows.
TODO, somehow port to Windows users.
EDIT: I've re-written the whole thing as a binary search algorithm, so it's exponentially faster now, and gives an exact result rather than approximation. I suggest cloning the repository again. If someone wants to write the new version in powershell I could add it to my repository and link credit your GitHub so it's all in the one place, or you could make something better on your own, I'll leave it with you, however I think this should be left as scripts and not a hosted webpage, that's too open for abuse.
Windows or other web users, for a workaround paste the code below in here - https://repl.it/languages/bash, you just need to set the job_id (without pointy brackets).
see it in action - https://github.com/b3n-j4m1n/salary-seeker/raw/master/demo.gif
It's a bash script, so you need a Unix-like OS, or something like Cygwin for Windows.
TODO, somehow port to Windows users.
EDIT: I've re-written the whole thing as a binary search algorithm, so it's exponentially faster now, and gives an exact result rather than approximation. I suggest cloning the repository again. If someone wants to write the new version in powershell I could add it to my repository and link credit your GitHub so it's all in the one place, or you could make something better on your own, I'll leave it with you, however I think this should be left as scripts and not a hosted webpage, that's too open for abuse.
Windows or other web users, for a workaround paste the code below in here - https://repl.it/languages/bash, you just need to set the job_id (without pointy brackets).
Code:
job_id=
counter='1'
response='1'
lower_limit='30000'
upper_limit='200000'
salary_var=$((lower_limit + (upper_limit - lower_limit) / 2))
job_title=$(curl --silent https://chalice-search-api.cloud.seek.com.au/search?jobid=$job_id | tr ',' '\n' | sed 's/{"title":"//g' | grep '"title":"' | cut -d '"' -f 4)
echo " | job title: "$job_title
while [[ $counter -lt '19' ]]
do
response=$(curl --silent "https://chalice-search-api.cloud.seek.com.au/search?jobid=$job_id&salaryrange=$salary_var-$upper_limit" | grep '"totalCount":1' | wc -l)
if [[ $response -eq '1' ]]
then
lower_limit=$salary_var
printf " | finding maximum > ""$""%d\r" "$salary_var"
salary_var=$(((salary_var + (upper_limit - salary_var) / 2)))
elif [[ $response -eq '0' ]]
then
upper_limit=$salary_var
printf " | finding maximum > ""$""%d\r" "$salary_var"
salary_var=$(((salary_var - (salary_var - lower_limit) / 2)))
fi
((counter++))
done
salary_max=$salary_var
counter='1'
lower_limit='30000'
upper_limit=$salary_max
salary_var=$((lower_limit + (upper_limit - lower_limit) / 2))
while [[ $counter -lt '16' ]]
do
response=$(curl --silent "https://chalice-search-api.cloud.seek.com.au/search?jobid=$job_id&salaryrange=$lower_limit-$salary_var" | grep '"totalCount":1' | wc -l)
if [[ $response -eq '1' ]]
then
upper_limit=$salary_var
printf " | finding minimum > ""$""%d\r" "$salary_var"
salary_var=$(((salary_var - (salary_var - lower_limit) / 2)))
elif [[ $response -eq '0' ]]
then
lower_limit=$salary_var
printf " | finding minimum > ""$""%d\r" "$salary_var"
salary_var=$(((salary_var + (upper_limit - salary_var) / 2)))
fi
((counter++))
done
salary_min=$salary_var
if [[ $salary_max -gt '199998' ]]
then
plus='+'
fi
echo -e " | salary range: ""\033[1m""$"$salary_min" - ""$"$salary_max$plus"\033[0m"