New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webogram

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webogram - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+1
-1
package.json
{
"name": "webogram",
"version": "1.0.2",
"version": "1.0.3",
"description": "Snap any web page through an Instagram inspired filter",

@@ -5,0 +5,0 @@ "bin":"./bin/webogram",

# Webogram
Snap web pages through Instagram inspired filters.
## Quick start
Install webogram with `npm` (requires Node.js):
```
$ npm install webogram -g
```
Then, pick a page to snap, [D3 visualizations](bl.ocks.org) are always amazing:
```
webogram http://bl.ocks.org/mbostock/raw/1893974/ -s 4000x4000 -z 5.0 -c 30x30x1000x1000 -p
```
Enjoy the results:
![](sample.png)
## Options
Here's `webogram --help`:
```
Usage: webogram <url> [options]
Options:
-s, --size size of image: WIDTHxHEIGHT, 400x300 [default: "512x512"]
-d, --delay delay before snapping [default: 200]
-o, --out out filename [default: "out.png"]
-z, --zoom zoom factor to apply [default: 1]
-c, --crop crop region: TOPxLEFTxWIDTHxHEIGHT, 10x20x500x500
-p, --preview preview the image? [default: false]
--filter, -f choose a filter
[choices: "vintage", "lomo", "clarity", "sinCity", "sunrise", "crossProcess",
"orangePeel", "love", "grungy", "jarques", "pinhole", "oldBoot", "glowingSun",
"hazyDays", "herMajesty", "nostalgia", "hemingway", "concentrate"]
```
Usually you want to play with `size`, provide a big canvas to start from, then
zoom in with `zoom` so that it fills up, and then crop it with `crop`.
You can preview the filters [here](http://camanjs.com/examples/)).
# Contributing
Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).
# Copyright
Copyright (c) 2016 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.
#!/usr/bin/env node
var filters = ["vintage", "lomo", "clarity", "sinCity", "sunrise", "crossProcess", "orangePeel", "love", "grungy", "jarques", "pinhole", "oldBoot", "glowingSun", "hazyDays", "herMajesty", "nostalgia", "hemingway", "concentrate"]
var argv = require('yargs')
.demand(1)
.alias('s', 'size')
.alias('d', 'delay')
.alias('o', 'out')
.alias('z', 'zoom')
.alias('c', 'clip')
.alias('p', 'preview')
.option('filter', {
alias: 'f',
describe: 'choose a filter',
choices: filters
})
.alias('f', 'filter')
.describe('s', 'Size of image')
.default({s: '512x512', d: 200, out: 'out.png', zoom: 1.0, preview:false})
.argv
var caman = require('caman').Caman
var ora = require('ora')
var open = require('open')
var colors = require('colors')
var phantomjs = require('phantomjs-prebuilt')
var binPath = phantomjs.path
var path = require('path')
var childProcess = require('child_process')
var outfile = argv.out
var clip = argv.clip || `0x0x${argv.size}`
var childArgs = [
path.join(__dirname, 'driver.js'),
argv._[0],
outfile,
argv.size,
argv.delay,
argv.zoom,
clip
]
var symbols = {
ok: '✓'.green,
err: '✖'.red,
}
var spinner = ora('Generating image...')
spinner.start()
childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {
spinner.stop()
if(err){
console.log(`${symbols.err} Error: ${err}`)
console.log(stdout)
process.exit(1)
}
console.log(`${symbols.ok} Done: ${outfile}`)
var openfn = function(){
if(argv.preview){
open(outfile)
}
}
if(argv.filter){
var applyingFilter = ora('Applying filter...')
applyingFilter.start()
caman(outfile, function(){
filter = this[argv.filter].bind(this)
if(filter){
filter()
}
this.render(function(){
this.save(outfile)
applyingFilter.stop()
console.log(`${symbols.ok} Filter: ${argv.filter}`)
openfn()
})
})
}else{
openfn()
}
})

Sorry, the diff of this file is not supported yet