#--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* #-- SCRIPT: autoseekjob.sh #-- #-- DESCRIPTION: #-- This file contains some command lines which automatically #-- submit an application on the #-- http://www.seek.com.au Australian Jobs site.. #-- The 'Seek' web-site has been set up in a manner that #-- encourages the users of the site to submit job #-- applications through the site rather than by directly #-- emailing the advertiser of the job. This is probably in order #-- to ensure that the job advertiser is aware that the #-- job-seeker has found the advertisement on the 'Seek' site. #-- #-- To this end, many of the job advertisements on the site do #-- not contain any email address for the advertiser. Instead #-- an 'Apply now' button/ link is provided on the Job-Ad #-- page which provides access to an online application #-- form. Once this form is filled out, its contents are #-- (apparently) emailed by some 'Seek' daemon to the #-- advertiser. #-- #-- The 'Seek' site has a number of mechanisms to #-- ensure that the user must access the application form #-- through the use of a traditional interactive browser #-- (using point-and-click), namely; #-- #-- a) There are a number of automatic redirects sent #-- to the client browser to #-- disguise the ultimate destination url (as opposed to #-- the url displayed as the form's/hyperlink's target #-- in the page-source html. #-- For example: #-- http://it.seek.com.au/showjob.asp?[job-id-number] #-- takes the web-client to a page containing #-- frames where the desired job-as url is #-- http://it.seek.com.au/users/joblist.asp?AdID=[job-id-number] #-- #-- b) #-- A cookie is sent to the web-client when the client #-- first views the job application. This cookie then #-- appears to be used to ensure that the web-client #-- viewing the application form has previously also #-- viewed the Job-ad. #-- #-- c) #-- The form in the job-application page contains a #-- hidden element with some kind of time-string value. #-- #-- The script below is an attempt to by-pass the #-- measures which the 'Seek' site developers have #-- used to disallow the non-interactive submission #-- of job-applications through the 'Seek' site. #-- #-- The purpose of the script is to obviate the #-- (slightly tedious) necessity of manually filling #-- out the job application form on the 'Seek' site #-- and therefore to allow the 'batch' or multiple #-- submission of Job applications. #-- #-- #-- DATES: #-- may 02 #-- NOTES: #-- The crucial tool used below is 'curl'. #-- Other tools that I attempted to use were wget and lynx. #-- The two key features that I needed in a non-interactive #-- web-client (to complete the task) were the capability #-- to send cookie data back to the web-server (in order to #-- fool the server into believing that a cookie had #-- previously been sent to the web-client) and the capability #-- to 'post' data to the web-server. #-- #-- The lynx text browser contains the ability to post data #-- with the --post_data command line switch, but I was unable #-- to discover how to send cookie data back to the server #-- with lynx. (The --cookie_file switch did not do what I was #-- hoping). The 'wget' tool is capable of sending cookie data #-- but did not seem to be able to post data. #-- #-- The 'curl' tool contains both capabilities. #-- This script was a late-night 'folly' spurred on by my annoyance #-- at having to continually fill out the 'Seek' job application #-- form with the same information, over and over again #-- (especially in a job-market atmosphere where most of the #-- job application seem to be ignored anyway) #-- AUTHOR: matthew bishop #-- STATUS: dev #--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* # This line doesnt work because there is no cookie file (hed.txt) # curl -d txtAdID=1933148 'http://it.seek.com.au/users/JobApply.asp?txtAdID1933148&' | less #-- Test if the job-id number is still valid #-- (That the advertisement has not been removed from the #-- 'Seek' site. if [ -n "$1" ]; then jobid=$1 else #-- testing jobid=1933149 fi url1=http://it.seek.com.au/users/joblist.asp?AdID=$jobid url2=http://it.seek.com.au/showjob.asp?jobid=$jobid url3=http://it.seek.com.au/users/JobApply.asp?txtAdID$jobid'&' # echo url3=$url3 # return; removed=$(wget -nd -O - -o t.log $url1 | grep -i 'recently removed this position' | wc -l) removed=$(echo $removed | sed 's/ //g') if [ $removed -eq 1 ]; then echo "'Seek' id-number=$jobid (removed)" return 1 fi #-- Capture the cookie which is sent to the web-client by the #-- 'showjob' page curl -D seek-cookie.txt $url2 #-- Use curl to post data and retrieve the on-line job-app form curl -b seek-cookie.txt -d txtAdID=$jobid $url3 #-- to do: #-- sed the app form to insert good values (name,phone etc)