
On 08/18/2012 08:52 PM, Michael Orlitzky wrote:
I'm one bug away from a working program and need some help. I wrote a little utility that logs into LWN.net, retrieves an article, and creates an epub out of it.
I've created two pages where anyone can test this. The first just takes any username and password via post and sets a session variable. The second prints "Success." if the session variable is set, and "Failure." if it isn't. The bash script, #!/bin/bash COOKIE_JAR='/tmp/network-curl-test-bash.txt' POST_DATA='username=foo&password=bar' URL1='http://michael.orlitzky.com/tmp/network-curl-test1.php' URL2='http://michael.orlitzky.com/tmp/network-curl-test2.php' echo 'Logging in...' curl --cookie-jar "${COOKIE_JAR}" \ --data "${POST_DATA}" \ "${URL1}" echo 'Retrieving second page...' curl --cookie "${COOKIE_JAR}" \ "${URL2}" works: $ ./bash-test.sh Logging in... Retrieving second page... Success. The attached haskell program using Network.Curl, doesn't: $ runghc haskell-test.hs Logged in... Failure. Any help is appreciated =)