code logs -> 2008 -> Wed, 30 Apr 2008< code.20080429.log - code.20080501.log >
--- Log opened Wed Apr 30 00:00:41 2008
00:03 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
00:44 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Quit: Doing electrical maintenance on the house...]
01:24 Vornicus is now known as Vornicus-Latens
01:52 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
01:52 mode/#code [+o ToxicFrog] by ChanServ
04:23
<@ToxicFrog>
Hmm.
04:23
<@ToxicFrog>
Any HTTP gurus here?
04:24
<@ToxicFrog>
Specifically with knowledge of the internal workings of POST?
04:29
<@ToxicFrog>
Gnar. This looks unpleasant.
04:30
<@McMartin>
I always just had Tomcat sort it out for me. =P
04:30
<@ToxicFrog>
Maybe I should just abuse lynx and expect~
04:30
<@ToxicFrog>
The issue here is that I have a directory full of images. I need to (1) upload these to an image hosting site and (2) generate a mapping from file names to image host URLs.
04:31
<@ToxicFrog>
The result of (2) is then fed to a script that does some processing to generate the appropriate links in my template.
04:31
<@McMartin>
Hrm. Yeah, that's going to be rough.
04:32
<@McMartin>
(1) is mean if you don't have a program to do it for you
04:32
<@McMartin>
That said, check curl's manual.
04:33
<@ToxicFrog>
Both curl and wget support POST
04:33
<@ToxicFrog>
However, curl only supports application/x-www-form-urlencoded format
04:34
<@ToxicFrog>
wget isn't clear on whether it supports multipart/form-data, which is what I need, but in either case they expect the user to construct the POST body themselves, and wget/curl then sends it to the server without further processing
04:41
<@ToxicFrog>
Hmm.
04:41
<@ToxicFrog>
I can seem to echo arrow keystrokes into lynx.
04:41
<@ToxicFrog>
can't, rather.
04:43
<@ToxicFrog>
...but I don't have to!
04:50
<@ToxicFrog>
I am inordinately amused by the fact that I am now working on a file called "waffle.lynx"
05:16 * ToxicFrog winds Lynx's entrails out on a stick
05:17 William__ is now known as JeffL
05:29
<@McMartin>
Entrails!
05:29
<@McMartin>
Onna stick!
05:40 * Shoukanjuu roasts them over a fire built by burning WoW boxes
05:45 Jeff [~JPL@Nightstar-12594.dsl.sndg02.pacbell.net] has joined #code
05:46 JeffL [~JPL@Nightstar-12594.dsl.sndg02.pacbell.net] has quit [Ping Timeout]
06:48 AnnoDomini [AnnoDomini@Nightstar-28859.neoplus.adsl.tpnet.pl] has joined #Code
06:48 mode/#code [+o AnnoDomini] by ChanServ
07:25 Kazriko [~kaz@Nightstar-26352.gdj-co.client.bresnan.net] has quit [Quit: Leaving]
08:15 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
08:15 mode/#code [+o gnolam] by ChanServ
08:36 You're now known as TheWatcher
08:55 Kazriko [~kaz@Nightstar-26352.gdj-co.client.bresnan.net] has joined #code
08:55 mode/#code [+o Kazriko] by ChanServ
10:01 Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has joined #code
10:01 mode/#code [+o Thaqui] by ChanServ
10:05 William__ [~JPL@Nightstar-12594.dsl.sndg02.pacbell.net] has joined #code
10:06 Jeff [~JPL@Nightstar-12594.dsl.sndg02.pacbell.net] has quit [Ping Timeout]
10:11 AnnoDomini [AnnoDomini@Nightstar-28859.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
10:18 AnnoDomini [AnnoDomini@Nightstar-29063.neoplus.adsl.tpnet.pl] has joined #Code
10:18 mode/#code [+o AnnoDomini] by ChanServ
10:37 * TheWatcher readsup
10:41
<@TheWatcher>
use WWW::Mechanize; my $mech = WWW::Mechanize -> new(); ... do login as necessary...; my @files = glob("$path/*.jpg"); foreach my $filename (@files) { $mech -> get($upload_form_location); my $form = $mech -> form_name('nameofuploadform'); $form -> value('filefield', $filename); $mech -> submit(); ... check $mech -> success() and $mech -> content() to confirm upload...; ... work out the url for the name and print it... }
10:41
<@TheWatcher>
Perl, obviously
10:54 Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has left #code [Leaving]
13:21 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
13:21 Reiv [~reaverta@Admin.Nightstar.Net] has joined #Code
13:22 DiceBot [~Reiver@Nightstar-25200.xdsl.xnet.co.nz] has quit [Ping Timeout]
13:28 DiceBot [~Reiver@Nightstar-9428.xdsl.xnet.co.nz] has joined #Code
14:54 Attilla [~The.Attil@194.72.70.ns-11849] has quit [Quit: <Insert Humorous and/or serious exit message here>]
15:02 Attilla [~The.Attil@194.72.70.ns-11849] has joined #code
15:02 mode/#code [+o Attilla] by ChanServ
15:46 DiceBot [~Reiver@Nightstar-9428.xdsl.xnet.co.nz] has quit [Ping Timeout]
15:47 Reiv [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
15:50 DiceBot [~Reiver@Nightstar-22562.xdsl.xnet.co.nz] has joined #Code
15:58 Reiver [~reaverta@Nightstar-22562.xdsl.xnet.co.nz] has joined #Code
15:58 mode/#code [+o Reiver] by ChanServ
16:10 Reiver [~reaverta@Nightstar-22562.xdsl.xnet.co.nz] has quit [Quit: Changing servers]
16:10 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
16:10 mode/#code [+o Reiver] by ChanServ
16:56 Vornicus-Latens is now known as Vornicus
16:56
<@ToxicFrog>
TheWatcher: thanks, but I sorted it by remote-controlling lynx to do the upload for me.
16:57
<@ToxicFrog>
(and save the resulting page, which I then parse)
16:57
<@ToxicFrog>
...hmm
16:57
<@ToxicFrog>
I was planning to mount this disk on /media, but I now remember that's reserved.
17:01
<@TheWatcher>
TF: okies
17:02
<@ToxicFrog>
(it's actually kind of cool. You can tell lynx to save your keystrokes to a file. You can also tell it to read such a file and act on the contents.)
17:02
<@ToxicFrog>
(so I generate a file with the right keystrokes to open the page, upload a file, and save the result to a known filename)
17:11 You're now known as TheWatcher[afk]
18:26 You're now known as TheWatcher
19:34 William__ is now known as Jeff
20:01 Shoukanjuu [~Shoukanju@Nightstar-18016.dhcp.embarqhsd.net] has quit [Ping Timeout]
20:04 Shoukanjuu [~Shoukanju@Nightstar-18016.dhcp.embarqhsd.net] has joined #code
23:01 You're now known as TheWatcher[T-2]
23:09 You're now known as TheWatcher[zZzZ]
23:53 AnnoDomini [AnnoDomini@Nightstar-29063.neoplus.adsl.tpnet.pl] has quit [Quit: Some people find sanity a little confining.]
--- Log closed Thu May 01 00:00:46 2008
code logs -> 2008 -> Wed, 30 Apr 2008< code.20080429.log - code.20080501.log >