This is a simple but conveinant socket script i created to help me and anyone else threw the job hunt process. Im tired looking threw hundreds job posts multiple times a day just to find 1 or 2 new post and still overlook some, let me tell you its a real pain in the ass. This script is created to do that for you acurately in secounds. It works in the u.s for sure.
Installation/use:
Just put this code in your remote, find it in your popups and choose your city then search; you may need to go to craigs list and look at the city options for your state (smaller citys). The first time you search all posts are going to be new so it will flood both windows. After that it should only return new post in @newyobs and the full list in @jobs.
Make sure you have these here C:\store.txt,C:\storen.txt and C:\trash.txt.
Feel free to change the script however you like.
known Bugs:
1 out of 20 times it will double link a new posts with a random link....yourll see.
i did not create the nohtml alias everything else i did myself with some guidence.
i did not test the .set update timer popup but i set that timer manualy works awsome at every 30min.
menu * {
Search Jobs ( $+ %city $+ )
.Search %city : trans
.Option
..New City : set %city $$?="Enter your city with no spaces:"
..Set Update Timer : .Timerupdate $$?="How Many Times:" $$?="Every __ Seconds:" Trans
-
}
alias nohtml { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x } alias -l htm { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
;alias
alias checkn {
set %i 1
:ho
write -c C:\trash.txt
if (%i <= $lines(c:\store.txt)) {
filter -ff C:\storen.txt C:\trash.txt $read(C:\store.txt,%i)
if ($read(C:\trash.txt,1) != $read(C:\store.txt,%i)) {
echo @newyobs $read(C:\store.txt,%i)
}
inc %i
goto ho
}
}
alias trans {
write -c c:\storen.txt
.copy -a C:\store.txt c:\storen.txt
.timer 1 1 sockopen cl %city $+ .craigslist.org 80
}
;1st page lister.
on *:sockopen:cl:{
.timer 1 1.5 sockopen cd %city $+ .craigslist.org 80
set %trash on
window -c @Jobs
window -R @Jobs
window -d @NewYobs
set %listn 1
write -c c:\store.txt
sockwrite -n $sockname GET /jjj/ HTTP/1.1
sockwrite -n $sockname Host: %city $+ .craigslist.org
sockwrite -n $sockname User-Agent: Mozilla/5.0
sockwrite -n $sockname Accept: text/html
sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
sockwrite -n $sockname Keep-Alive: 300
sockwrite -n $sockname Connection: keep-alive
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:cl: {
sockread %temp
if (Copyright isin $nohtml(%temp)) { set %trash on }
if (%trash = off) {
write C:\store.txt $replace($gettok($nohtml(%temp),1,38),$,3D1.)
write C:\store.txt 2http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs . $gettok($nohtml(%temp),1,38)
echo @jobs 2----------------------------------------------------------- http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs -
inc %listn
if (302 Found isin %temp) { set %bc on | echo @jobs ok }
}
if (AVOIDING isin $nohtml(%temp)) { set %trash off }
}
;2nd page lister.
on *:sockopen:cd:{
set %trash on
.timer 1 1.5 sockopen ct %city $+ .craigslist.org 80
set %listn 1
sockwrite -n $sockname GET /jjj/index100.html HTTP/1.1
sockwrite -n $sockname Host: %city $+ .craigslist.org
sockwrite -n $sockname User-Agent: Mozilla/5.0
sockwrite -n $sockname Accept: text/html
sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
sockwrite -n $sockname Keep-Alive: 300
sockwrite -n $sockname Connection: keep-alive
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:cd: {
sockread %temp
if (Copyright isin $nohtml(%temp)) { set %trash on }
if (%trash = off) {
write C:\store.txt $replace($gettok($nohtml(%temp),1,38),$,3D1.)
write C:\store.txt 2http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs . $gettok($nohtml(%temp),1,38)
echo @jobs 2----------------------------------------------------------- http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs -
inc %listn
if (302 Found isin %temp) { set %bc on | echo @jobs ok }
}
if (AVOIDING isin $nohtml(%temp)) { set %trash off }
}
;3 page load---------------------.
on *:sockopen:ct:{
set %trash on
.timer 1 2 checkn
echo @newyobs -
echo @newyobs -------------------------------------------------------
echo @newyobs Checking New Jobs........Update Time..; $+ $timestamp
echo @newyobs -------------------------------------------------------
echo @newyobs -
set %listn 1
sockwrite -n $sockname GET /jjj/index200.html HTTP/1.1
sockwrite -n $sockname Host: %city $+ .craigslist.org
sockwrite -n $sockname User-Agent: Mozilla/5.0
sockwrite -n $sockname Accept: text/html
sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
sockwrite -n $sockname Keep-Alive: 300
sockwrite -n $sockname Connection: keep-alive
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:ct: {
sockread %temp
if (Copyright isin $nohtml(%temp)) { set %trash on }
if (%trash = off) {
write C:\store.txt $replace($gettok($nohtml(%temp),1,38),$,3D1.)
write C:\store.txt 2http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs . $gettok($nohtml(%temp),1,38)
echo @jobs 2----------------------------------------------------------- http:// $+ %city $+ .craigslist.org $+ $gettok(%temp,2,34)
echo @jobs -
inc %listn
if (302 Found isin %temp) { set %bc on | echo @jobs ok }
}
if (AVOIDING isin $nohtml(%temp)) { set %trash off }
}