A hook to download files through HTTP. Based on the http-get module by Stefan Rusu.
Please note that travis-ci.org does not build this correctly because the module requires node v 0.4.11 but travis has 0.4.8 installed at this point.
npm install -g hook.io-wget
./bin/hookio-wget
This starts a hook and reads the local config.json. The files found there will be downloaded or a head will be requested. A sample is provided in examples/example-config.json. The config option is included for debugging and testing purposes, in general you will want to use messages and code.
wget::download [in]
url: the url to download from. Required. Redirects are supported
target: the target file name. Required.
headers: Optional headers to pass along. See http-get for details
nogzip: Optionally prevents automatic uncompression. See http-get for details
proxy: Optional proxy settings. See http-get for details
redirects: Optional max number of redirects. See http-get for details
wget::head [in]
url: the url to download from. Required. Redirects are supported
target: the target file name. Required.
headers: Optional headers to pass along. See http-get for details
proxy: Optional proxy settings. See http-get for details
redirects: Optional max number of redirects. See http-get for details
wget::error [out]
error: See examples/download-error.txt for content
head: Boolean, true if this was a head only operation
wget::download-complete [out]
code : The http code
pathToFile : The path to the downloaded file
headers : The headers from the response
requestedUrl : The originally requested url
downloadedUrl : The actual url, after redirects
result : The verbatim result from http-get
See examples/download-complete.txt
wget::head-complete [out]
code : The http code
headers : The headers from the response
requestedUrl : The originally requested url
downloadedUrl : The actual url, after redirects
result : The verbatim result from http-get
The package config contains experimental hook.io schema definitions. The definition is also exported as hook.
Wget = require("hook.io-wget").Wget
hook = new Wget(name: 'wget')
var Wget = require("hook.io-wget").Wget;
var hook = new Wget({ name: 'wget' });
Check out
Follow us on Twitter at
- @getscottyapp
- @martin_sunset
and like us on Facebook please. Every mention is welcome and we follow back.
Listened to lots of Pink while writing this.
- Coffeescript beautification project
- Tests working now
- Tests added, but not really working...
- Now supports @username:password in urls for basic authentication
- Added image assets
- exposed version and hook
- removed unnecessary dependencies
- added head message
- Fixed npm dependencies
- First version
- npm run-script watch
- Change version in package.json
- git tag -a v0.0.7 -m 'version 0.0.7'
- git push --tags
- npm publish
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
- Fork the project
- Start a feature/bugfix branch
- Commit and push until you are happy with your contribution
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the package.json, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright (c) 2011 Martin Wawrusch. See LICENSE for further details.