Make my job easier-me-do

From: Ken (SHIELDSIT) 9 Jul 2013 12:30
To: Kenny J (WINGNUTKJ) 9 of 34
 %-) I blame it on lack of sleep.  Great minds and all that!  Sorry though, I just skimmed the posts and was really excited that I had something that might be useful.
From: koswix 9 Jul 2013 13:05
To: ANT_THOMAS 10 of 34
Can't install anything, these are old creaky machines with XP Pro (actually not that creaky, but the booking software only runs on XP). We do have Firefox though, if that matters.

Comparison sites are:
FHR
Skyparks
Park & Go
Secure Airport Parking
NCP
Purple Parking
Holiday Extras

From: koswix 9 Jul 2013 13:05
To: ANT_THOMAS 11 of 34
(giggle)
From: koswix 9 Jul 2013 13:06
To: Kenny J (WINGNUTKJ) 12 of 34
Ooh, that could be useful - if not for outputting to a CSV then at least save me filling in the forms each time.

EDIT: actually, seems that's *exactly* what it does. Must resist urge to play now because I'll probably break something...
EDITED: 9 Jul 2013 13:11 by KOSWIX
From: koswix 9 Jul 2013 13:07
To: PNCOOL 13 of 34
There more booking agents rather than comparison sites - each one charges a different price for the same place based on their fees etc. In the competitive world of airport parking we need to keep a daily eye on what the other parks are charging and adjust our prices accordingly.
From: koswix 9 Jul 2013 13:08
To: Ken (SHIELDSIT) 14 of 34
I think Kenny's one would be better.
From: Ken (SHIELDSIT) 9 Jul 2013 13:14
To: koswix 15 of 34
Why you racist mother fucker!
From: koswix 9 Jul 2013 16:46
To: Kenny J (WINGNUTKJ) 16 of 34
The page URLs seem to be in a pretty straightforward format. Example:

http://www.fhr-net.co.uk/airport-parking/results/?airport=13&parking-from=16%2F07%2F2013&parking-start-hour=09&parking-start-min=00&parking-to=16%2F07%2F2013&parking-end-hour=17&parking-end-min=00

So obviously you have airport, arrival day/time, departure day/time. Wonder if it'll be easier to automate it via the URL. I've had a quick play (NJ) with iMacro and I'm already out of my depth :D
From: ANT_THOMAS 9 Jul 2013 16:49
To: koswix 17 of 34
Are all the URLs like that? I haven't checked out the ones that you linked but I will have a look in a min. If they are similar a bit of wget grep and sed in a bash script would no doubt give you something usable.
From: koswix 9 Jul 2013 16:58
To: ANT_THOMAS 18 of 34
Just checking them now - NCP is a cunt, but hopefully the rest are OK. I wouldn't mind just having to check NCP.

https://prebook.ncp.co.uk/public/NCP/flow.htm?_flowExecutionKey=_cDD3E98EF-FF8C-8537-4390-E15C82AA8080_k29162C6C-4EFB-F891-8208-D3A86F669727
From: ANT_THOMAS 9 Jul 2013 17:11
To: koswix 20 of 34
FHR and purpleparking look the easiest to script.
From: koswix 9 Jul 2013 17:19
To: ANT_THOMAS 21 of 34
Yeah, the rest are bastards. Going to have to knuckle down and work out how to use this iMacro thingy.
From: Drew (X3N0PH0N) 9 Jul 2013 18:42
To: koswix 22 of 34
curl (on the unix/linux command line) can get/post to forms. A combination of curl, date and some regex should do what you want in a nice way. You could even set it as a cron job and make it do this every hour or whatever and spit the results into a csv file or something.

I realise, obviously, that you're unlikely to have a linux command line on your work machine but if you can either SSH in to a linux machine somewhere or simply have the script do the above and upload the CSV/text file somewhere where you can access it via http. Or there's always Cygwin.

I'd offer to do this for you but I absolutely lick balls at regex. I did make a script the other day to pull a random picture of the day from Wikipedia and set it as my wallpaper, which is doing roughly the same sort of thing, but that pretty much reached the outer limit of my ability with regex. I'll link it in case it's helpful but I'm sure it's fucking awfully written.

http://privatepaste.com/d0ddcea77a


From: ANT_THOMAS 9 Jul 2013 18:45
To: Drew (X3N0PH0N) 23 of 34
I've managed to get all the prices and airports from the first link with a load of greps then I stopped there :$
EDITED: 9 Jul 2013 18:50 by ANT_THOMAS
From: Drew (X3N0PH0N) 9 Jul 2013 18:47
To: ANT_THOMAS 24 of 34
:')

I hate doing anything regexy. Spend like 5 hours learning what I need to to make the thing, make the thing, then instantly forget everything I knew.
From: Kenny J (WINGNUTKJ) 9 Jul 2013 19:02
To: Drew (X3N0PH0N) 25 of 34
The secret to regexp is to always write a very detailed comment about what each section of the statement means, what it is intended to do, and why. And then give up regexp and do something less soul-destroying instead.
From: koswix 9 Jul 2013 21:06
To: Drew (X3N0PH0N) 26 of 34
Can I SSH into your machine? :D

And where the heck is PB? He'd have this done already :C
From: ANT_THOMAS 9 Jul 2013 21:16
To: koswix 27 of 34
Exactly what I thought. PB would've had it made and you sacked and him employed remotely to do your job in 15 mins each day.
From: koswix 9 Jul 2013 21:19
To: ANT_THOMAS 28 of 34
He can park cars remotely?!