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
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.send('Hello World'); | |
}); | |
var server = app.listen(3000, function() { | |
console.log('Listening on port %d', server.address().port); | |
}); |
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
// author: yes | |
// 1. Use Picasa first to set geolocation for photos. | |
// 2. Use this file to read geolocation info in the exif. | |
var readline = require('readline'); | |
var gm = require('gm'); | |
var imageMagick = gm.subClass({ | |
imageMagick: true | |
}); |
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
--- | |
--- | |
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
hi i'm yes | |
<ul> |
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
var cp = require('child_process'); | |
// show keywords of photo | |
cp.exec('exiftool -keywords photo.jpg', function(err, stdout, stderr) { | |
console.log(stdout); | |
} |
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
http = require 'http' | |
querystring = require 'querystring' | |
postData = querystring.stringify | |
'__VIEWSTATE': '/wEPDwUKMTkxNTE3NzM4MA9kFgJmD2QWAgIDD2QWCAIBDw8WAh4EVGV4dAUM5pyD5ZOh55m75YWlZGQCAw8WAh8ABesGIDxkaXYgc3R5bGU9J2Rpc3BsYXk6IG5vbmU7Jz48YSBocmVmPSdSQS9SQV9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90ZXN0Mi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nVkwvVkxfaW5kZXguYXNweCcgdGFyZ2V0PSdfc2VsZic+PGltZyBzcmM9J2ltYWdlcy90b3BwaWMvYi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nUlQvUlRfMl9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90cmFpbDEuanBnJyBhbHQ9J+WPsOeBo+Wxseael+aCoOmBiue2sicgdGl0bGU9J+WPsOeBo+Wxseael+aCoOmBiue2sicvPjwvYT48L2Rpdj4gPGRpdiBzdHlsZT0nZGlzcGxheTogbm9uZTsnPjxhIGhyZWY9J0ZQL0ZQX2luZGV4LmFzcHgnIHRhcmdldD0nX3NlbGYnPjxpbWcgc3JjPSdpbWFnZXMvdG9wcGl |
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
request = require 'request' # https://github.com/request/request | |
cheerio = require 'cheerio' # https://github.com/cheeriojs/cheerio | |
optionsLogin = | |
'method': 'POST' | |
'url': 'http://recreation.forest.gov.tw/index.aspx' | |
'followRedirect': false | |
'form': | |
'__VIEWSTATE': '/wEPDwUKMTkxNTE3NzM4MA9kFgJmD2QWAgIDD2QWCAIBDw8WAh4EVGV4dAUM5pyD5ZOh55m75YWlZGQCAw8WAh8ABesGIDxkaXYgc3R5bGU9J2Rpc3BsYXk6IG5vbmU7Jz48YSBocmVmPSdSQS9SQV9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90ZXN0Mi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nVkwvVkxfaW5kZXguYXNweCcgdGFyZ2V0PSdfc2VsZic+PGltZyBzcmM9J2ltYWdlcy90b3BwaWMvYi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nUlQvUlRfMl9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90cmFpbDEuanBnJyBhbHQ9J+WPsOeBo+Wxseael+aCoOmBiue2sicgdGl0bGU9J+WPsOeBo |
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
request = require 'request' # https://github.com/request/request | |
cheerio = require 'cheerio' # https://github.com/cheeriojs/cheerio | |
optionsLogin = | |
'method': 'POST' | |
'url': 'http://recreation.forest.gov.tw/index.aspx' | |
'followRedirect': false | |
'form': | |
'__VIEWSTATE': '/wEPDwUKMTkxNTE3NzM4MA9kFgJmD2QWAgIDD2QWCAIBDw8WAh4EVGV4dAUM5pyD5ZOh55m75YWlZGQCAw8WAh8ABesGIDxkaXYgc3R5bGU9J2Rpc3BsYXk6IG5vbmU7Jz48YSBocmVmPSdSQS9SQV9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90ZXN0Mi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nVkwvVkxfaW5kZXguYXNweCcgdGFyZ2V0PSdfc2VsZic+PGltZyBzcmM9J2ltYWdlcy90b3BwaWMvYi5qcGcnIGFsdD0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJyB0aXRsZT0n5Y+w54Gj5bGx5p6X5oKg6YGK57ayJy8+PC9hPjwvZGl2PiA8ZGl2IHN0eWxlPSdkaXNwbGF5OiBub25lOyc+PGEgaHJlZj0nUlQvUlRfMl9pbmRleC5hc3B4JyB0YXJnZXQ9J19zZWxmJz48aW1nIHNyYz0naW1hZ2VzL3RvcHBpYy90cmFpbDEuanBnJyBhbHQ9J+WPsOeBo+Wxseael+aCoOmBiue2sicgdGl0bGU9J+WPsOeBo |
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
request = require 'request' # https://github.com/request/request | |
cheerio = require 'cheerio' # https://github.com/cheeriojs/cheerio | |
form = | |
'__VIEWSTATE': viewstate | |
'__EVENTVALIDATION': '/wEWBwK6/o7eDgK23+DHBQKP48TJBwKj360MAqmqibEJAuH354MMAu2LvqIIlo3AZ3cxBMksG9AnBmqNoeKydSOHjl33UiOdH319ygk=' | |
'ctl00$ContentPlaceHolder1$ID_TextBox': '[email protected]' | |
'ctl00$ContentPlaceHolder1$Pass_TextBox': 'iamahutcrawler1' | |
'ctl00$ContentPlaceHolder1$btn_login': '登入' |
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
request = require 'request' # https://github.com/request/request | |
cheerio = require 'cheerio' # https://github.com/cheeriojs/cheerio | |
async = require 'async' | |
async.waterfall([ | |
(cb) -> | |
request 'http://recreation.forest.gov.tw/index.aspx', (err, res, body) -> | |
$ = cheerio.load body | |
# console.log 'open homepage: ' + res.statusCode | |
# console.log res.headers |
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
data = ['h', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd'] | |
d3.select 'body' | |
.selectAll 'p' | |
.data data | |
.enter() | |
.append 'p' | |
.text (d) -> d |
OlderNewer