Created
September 16, 2011 08:09
-
-
Save bizenn/1221511 to your computer and use it in GitHub Desktop.
Simple script for inspection of clojure.contrib.http.agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: clojure; coding: utf-8-unix -*- | |
;; clojure.contrib.http.agentの動作検証用スクリプト | |
(ns http-agent-test.core | |
(:use [clojure.contrib.http.agent :as ha :only [http-agent stream status]] | |
[clojure.java.io :as io :only [output-stream copy]])) | |
(defn get-agent [url file] | |
(ha/http-agent url | |
:handler | |
(fn [this] | |
(with-open [out (io/output-stream file)] | |
(io/copy (stream this) out))))) | |
(defn wait&status [agt] | |
(result agt) | |
(status agt)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment