trivial-download

https://github.com/eudoxia0/trivial-download.git

git clone 'https://github.com/eudoxia0/trivial-download.git'

(ql:quickload :trivial-download)
15

trivial-download

Build Status Coverage Status

trivial-download allows you to download files from the Internet from Common Lisp. It even provides a progress bar.

Usage

cl-user> (download "http://www.google.com/robots.txt" "/tmp/robots.txt")
Downloading "http://www.google.com/robots.txt" (Unknown size)
t
cl-user> (download "https://github.com/favicon.ico" "/tmp/favicon.ico")
Downloading "https://github.com/favicon.ico" (6.518 kB)
.........10%.........20%.........30%.........40%.........50%.........60%.........70%.........80%.........90%.........100%t

Documentation

You probably want the download function, which downloads files from the network to the local disk. If you want more control over that – like, say, writing the downloaded bytes to a database instead – you want the with-download macro.

trivial-download downloads everything in chunks that are *chunk-size* bytes long. *chunk-size*, by default, is 256.

Downloads the content of url and writes it to output. The file is written as it is downloaded, chunk-by-chunk, not downloaded into memory and written at once.

Downloads the contents of url, executing body in every chunk.

The extra arguments are:

Example:

(with-download "https://github.com/favicon.ico"
  ;; Do something
  )

The same as with-download, only this prints progress information while downloading.

License

Copyright (c) 2014-2015 Fernando Borretti (eudoxiahp@gmail.com)

Licensed under the MIT License.