├── demo.gif ├── README.md └── salary-seeker.sh /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b3n-j4m1n/salary-seeker/HEAD/demo.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # salary-seeker 2 | 3 | The jobs listed on seek.com.au usually hide the salary range. You can use salary range search filters, but this is tedious and still vague. 4 | 5 | This tool modifies URL parameters and brute-forces the salary range of the job through a binary search algorithm. 6 | ``` 7 | bash-3.2# ./salary-seeker.sh 8 | | usage: ./salary-seeker.sh 9 | | job id can be found in the URL of the job, e.g. https://www.seek.com.au/job/38035537 <--- here 10 | | example: ./salary-seeker.sh 38035537 11 | ``` 12 |

13 | 14 |

15 | -------------------------------------------------------------------------------- /salary-seeker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | job_id=$1 4 | counter='1' 5 | response='1' 6 | lower_limit='30000' 7 | upper_limit='200000' 8 | salary_var=$((lower_limit + (upper_limit - lower_limit) / 2)) 9 | 10 | if [[ $# = 0 ]] 11 | then 12 | echo " | usage: ./salary-seeker.sh " 13 | echo " | job id can be found in the URL of the job, e.g. https://www.seek.com.au/job/38035537 <--- here" 14 | echo " | example: ./salary-seeker.sh 38035537" 15 | exit 1 16 | fi 17 | 18 | job_title=$(curl --silent https://jobsearch-api.cloud.seek.com.au/search?jobid=$job_id | tr ',' '\n' | sed 's/{"title":"//g' | grep '"title":"' | cut -d '"' -f 4) 19 | echo " | job title: "$job_title 20 | keywords=$(curl --silent https://jobsearch-api.cloud.seek.com.au/search?jobid=$job_id | sed "s/.*$job_id\(.*\)teaser.*/\1/" | cut -d '"' -f 8 | tr -c '[:alnum:]\n\r' '+') 21 | advertiser_id=$(curl --silent https://jobsearch-api.cloud.seek.com.au/search?jobid=$job_id | sed "s/.*advertiser\(.*\)description.*/\1/" | cut -d '"' -f 5) 22 | 23 | #find maximum 24 | while [[ $counter -lt '19' ]] 25 | do 26 | response=$(curl --silent "https://jobsearch-api.cloud.seek.com.au/search?keywords=$keywords&advertiserid=$advertiser_id&sourcesystem=houston&salaryrange=$salary_var-$upper_limit" | grep "$job_id" | wc -l) 27 | if [[ $response -eq '1' ]] #if it's found 28 | then 29 | lower_limit=$salary_var 30 | printf " | finding maximum > ""$""%d\r" "$salary_var" 31 | salary_var=$(((salary_var + (upper_limit - salary_var) / 2))) 32 | elif [[ $response -eq '0' ]] #if it's not found 33 | then 34 | upper_limit=$salary_var 35 | printf " | finding maximum > ""$""%d\r" "$salary_var" 36 | salary_var=$(((salary_var - (salary_var - lower_limit) / 2))) 37 | fi 38 | ((counter++)) 39 | done 40 | 41 | salary_max=$salary_var 42 | 43 | #reset variables 44 | counter='1' 45 | lower_limit='30000' 46 | upper_limit=$salary_max 47 | salary_var=$((lower_limit + (upper_limit - lower_limit) / 2)) 48 | 49 | #find minimum 50 | while [[ $counter -lt '16' ]] 51 | do 52 | response=$(curl --silent "https://jobsearch-api.cloud.seek.com.au/search?keywords=$keywords&advertiserid=$advertiser_id&sourcesystem=houston&salaryrange=$lower_limit-$salary_var" | grep "$job_id" | wc -l) 53 | if [[ $response -eq '1' ]] #if it's found 54 | then 55 | upper_limit=$salary_var 56 | printf " | finding minimum > ""$""%d\r" "$salary_var" 57 | salary_var=$(((salary_var - (salary_var - lower_limit) / 2))) 58 | elif [[ $response -eq '0' ]] #if it's not found 59 | then 60 | lower_limit=$salary_var 61 | printf " | finding minimum > ""$""%d\r" "$salary_var" 62 | salary_var=$(((salary_var + (upper_limit - salary_var) / 2))) 63 | fi 64 | ((counter++)) 65 | done 66 | 67 | salary_min=$salary_var 68 | 69 | if [[ $salary_max -gt '199998' ]] 70 | then 71 | plus='+' 72 | fi 73 | 74 | echo -e " | salary range: ""\033[1m""$"$salary_min" - ""$"$salary_max$plus"\033[0m" 75 | --------------------------------------------------------------------------------