laundry
Data laundering tools
Last updated 3 months ago by endquote .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install laundry -g
SYNC missed versions from official npm registry.

Laundry

A command-line tool written with node.js for "laundering" data by moving it from one API to another in ways that the API authors didn't intend. Laundry can do things like:

  • make an RSS feed of all mentions of a hashtag on twitter
  • write all of your Instagram likes to a MySQL database
  • send anything posted to a Slack channel out over a websocket
  • turn your YouTube and Soundcloud subscriptions into podcasts

Washers

Laundry is made up of washers, each with an input or an output, or both. Any input can go to any output. The current washers are:

Input Output
local files JSON files
gMail search MySQL database
Instagram timeline, user, hashtag, likes Web socket (example)
Pinterest boards Pinterest boards
RSS RSS (with enclosures)
Slack channel Slack channel
Soundcloud timeline, artist
Tumblr blog, likes, timeline, hashtag
Twitter timeline, hashtag, list, user, favorites
Vimeo feed, user, tag, group, channel, category
Vogue fashion shows
YouTube subscriptions, channel

There are many more ideas for new washers and additions to existing washers, listed among the issues. Development of new washers is a great way to contribute to the project. There is more documentation on that if you're interested.

Jobs

The interface to Laundry is via the command-line, with subcommands to create, edit, run, and destroy jobs. A job specifies which input and output washers to use, any options required by the washers, and when to run the job. When creating a job, the CLI will ask whatever questions are needed to configure the washers, and the configuration of all jobs is stored in a file.

The commands are shown in laundry --help.

Commands:

create [job]   configure a new job
edit [job]     edit an existing job
run [job]      run an existing job (or "all" to run all jobs)
destroy [job]  destroy an existing job
list           list configured jobs
tick           run on an interval or cron to trigger scheduled jobs

Jobs can run on an interval (every 20 minutes, every hour), at a specific time (every day at noon), after another job completes (if you want to chain them together), or manually.

Storage

Input washers often can download media files as well as data, and output washers often create files. Those need to go somewhere. Laundry has a modular storage architecture, which allows for two types of storage at the moment: local to the machine it's running on, or on Amazon S3.

Storage settings are configured via command-line arguments or environment variables, as shown in the laundry --help.

Options:

-h, --help           output usage information
-V, --version        output the version number
--local [path]       path to use for local file storage, default is LAUNDRY_LOCAL
--s3key [key]        S3 access key ID, default is LAUNDRY_S3_KEY
--s3secret [secret]  S3 access key secret, default is LAUNDRY_S3_SECRET
--s3bucket [bucket]  S3 bucket, default is LAUNDRY_S3_BUCKET
--baseUrl [url]      the base URL that maps to the local folder or S3 bucket, default is LAUNDRY_BASEURL
--mediaAge [days]    the number of days to keep downloaded media around, default is 30
--proxy [proxy]      proxy to use for API requests, use "http://localhost:8888" when debugging with Charles
-v, --verbose        verbose output

Logs and configuration data are stored using the same storage method as washers. Development of new storage methods is a great way to contribute to the project. There is more documentation on that if you're interested.

Installation

Installation from npm is easy with npm install -g laundry.

You'll want to configure a storage solution as well. If you're using local storage, you'll pass the location of the output folder on the --local argument or LAUNDRY_LOCAL environment variable. You'll probably want to make that location accessible via a web server, the URL to which is passed on the --baseUrl argument or LAUNDRY_BASEURL environment variable.

If using S3 storage, it's the same idea, but using --s3key, --s3secret, and --s3bucket arguments.

You'll then need to run laundry tick every so often to trigger jobs.

On Mac/Linux, you'll probably want to use a wrapper script which you run via cron.

On Windows, you can use a batch file that runs on an interval via the task scheduler. Try importing this task and modifying as needed.

Running on Heroku

You can magically deploy to Heroku using the deploy button below. Since Heroku doesn't have a persistent filesystem, you'll want to store things on S3. The install process will ask you for a sensible app name and S3 settings.

Deploy

Then you'll need to configure jobs. Install the Heroku toolbelt, then get a shell with heroku run bash --app [app-name]. From there you can run the laundry commands such as node index.js list to list jobs, node index.js create foo to create a job called "foo", etc.

Laundry runs in daemon mode on Heroku, which means its dyno needs to be consistently running, which isn't possible on the free plan. The "hobby" plan should work fine, though.

Current Tags

  • 1.8.25                                ...           latest (3 months ago)

80 Versions

  • 1.8.25                                ...           3 months ago
  • 0.0.0                                ...           3 months ago
  • 1.8.24                                ...           2 years ago
  • 1.8.23                                ...           2 years ago
  • 1.8.22                                ...           2 years ago
  • 1.8.21                                ...           2 years ago
  • 1.8.20                                ...           2 years ago
  • 1.8.19                                ...           2 years ago
  • 1.8.18                                ...           2 years ago
  • 1.8.17                                ...           2 years ago
  • 1.8.16                                ...           2 years ago
  • 1.8.15                                ...           3 years ago
  • 1.8.14                                ...           3 years ago
  • 1.8.13                                ...           3 years ago
  • 1.8.12                                ...           3 years ago
  • 1.8.11                                ...           3 years ago
  • 1.8.10                                ...           3 years ago
  • 1.8.9                                ...           3 years ago
  • 1.8.8                                ...           3 years ago
  • 1.8.7                                ...           3 years ago
  • 1.8.6                                ...           3 years ago
  • 1.8.5                                ...           3 years ago
  • 1.8.4                                ...           3 years ago
  • 1.8.3                                ...           3 years ago
  • 1.8.2                                ...           3 years ago
  • 1.8.1                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 1.7.5                                ...           3 years ago
  • 1.7.4                                ...           3 years ago
  • 1.7.3                                ...           3 years ago
  • 1.7.2                                ...           3 years ago
  • 1.7.1                                ...           3 years ago
  • 1.7.0                                ...           3 years ago
  • 1.6.8                                ...           3 years ago
  • 1.6.7                                ...           4 years ago
  • 1.6.6                                ...           4 years ago
  • 1.6.5                                ...           4 years ago
  • 1.6.4                                ...           4 years ago
  • 1.6.3                                ...           4 years ago
  • 1.6.2                                ...           4 years ago
  • 1.6.1                                ...           4 years ago
  • 1.6.0                                ...           4 years ago
  • 1.5.12                                ...           4 years ago
  • 1.5.11                                ...           4 years ago
  • 1.5.10                                ...           4 years ago
  • 1.5.9                                ...           4 years ago
  • 1.5.8                                ...           4 years ago
  • 1.5.7                                ...           4 years ago
  • 1.5.6                                ...           4 years ago
  • 1.5.5                                ...           4 years ago
  • 1.5.4                                ...           4 years ago
  • 1.5.3                                ...           4 years ago
  • 1.5.2                                ...           4 years ago
  • 1.5.1                                ...           4 years ago
  • 1.5.0                                ...           4 years ago
  • 1.4.7                                ...           4 years ago
  • 1.4.6                                ...           4 years ago
  • 1.4.5                                ...           4 years ago
  • 1.4.4                                ...           4 years ago
  • 1.4.3                                ...           4 years ago
  • 1.4.2                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 8
This Month 8
Last Day 8
Last Week 1
Last Month 29
Dependencies (31)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |