daily henry
note: term(s) must be 4 or more letters long
 Recent: More: Topics:
(26 - 30 of 79)

Job search
last viewed: Dec 09, 2009, 09:12:00 AM (GMT)

Steve Earle tracks on Flash stream player
last viewed: Dec 09, 2009, 09:12:08 AM (GMT)

Garmin/grass5 arguments
last viewed: Dec 09, 2009, 09:12:00 AM (GMT)

Troopin' with Ten-in-ten
last viewed: Dec 09, 2009, 09:12:00 AM (GMT)

National Land Cover Survey layer
last viewed: Dec 09, 2009, 08:12:01 AM (GMT)

More (older posts):
 0  1  2  3  4  6  7  8  9  10  11  12  13  14  15 

Job search
  Last viewed: Dec 09, 2009, 09:12:00 AM (GMT)

Winnemucca, NV--Well, here's the news from here.

I found a 1908 house and was trying to buy it, but can't get a loan, being self-employed (Web sites, etc) but not having two years of tax returns to show. I think I'm going to go all out to find a job in the City.

I had a friend whose bicycle, a Specialized Sequoia, was stolen, and I wrote a script to search Craig's List for Sequoia. I have the script running every hour via cronjob. It seems to be working. When it finds any listings for sequoias that it has not previously found, it sends an email. Clever, eh? But with a few modifications, I should be able to convert it to search job listings for keywords such as "Linux" and "PHP" and "Apache." Also "Filemaker" and "Editor." It's been a terrific lazy summer of sunshine and laying around, but time's a-wasting...

Here's the script, if anyone's interested. If you improve it, for example as noted it should diff against the master results file to send ONLY the new stuff, be sure and send me back the improved copy. Basically, it's GPL'ed, though it's hardly worth calling a stupid bash script "licensed software."


#!/usr/local/bin/bash

query="$1";
email="$2";
path="/usr/home/iffy/Kati";
#cat=([1]=68 [2]=5 [3]=43 [4]=5 [5]="" [6]="" [7]=43 [8]=5 [9]=5 [10]=5 [11]=5 [12]=5 [13]="" [14]="" [15]="" [16]=""); #broken: bash can't do $cat[$i], so for now can't limit to "bike" or "for sale"

touch $path/$query; # stops a division by zero error on first run
let i=1;
while [ $i -lt 17 ]; do
uri="http://www.craigslist.org/cgi-bin/search.cgi?query=$query&areaID=$i&subAreaID=&group=S&cat=";
a=$(wc -l $path/$query | awk '{print $1}');
/usr/local/bin/wget -q -O - "$uri" \
|grep -v "value=\"$query\"" \
|grep -v "search.cgi" \
|grep -i "$query" \
> $path/$query.new;
cat $path/$query.new >> $path/$query;
b=$(wc -l $path/$query |awk '{print $1}');
if [ $b -gt $a ]; then # we found something
sort $path/$query \
| uniq \
> $path/$query.uniq;
c=$(wc -l $path/$query.uniq |awk '{print $1}');
if [ $c -gt $a ]; then # we found something new
mail -s "$uri" $email < $path/$query.new; # crude; should diff $query
else cp $path/$query.uniq $path/$query; # removes duplicates
fi;
fi;
i=$(($i + 1));
done;
exit 0

top

All

Nevada (19 posts)

Bicycle Rides (17 posts)

Cerebral Events (5 posts)

Utterly Banal (20 posts)

Bibliography (7 posts)

[ Colophon | Henry's Homepage | Milly Site ]