This file contains hidden or 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
package AnyEvent::Search::Scrape::Zin; | |
use strict; | |
use utf8; | |
use Carp; | |
use Encode; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use URI::Escape; | |
use Web::Scraper; |
This file contains hidden or 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
package WWW::Search::Scrape::Melon; | |
use strict; | |
use Carp; | |
use utf8; | |
use Encode; | |
use LWP::UserAgent; | |
use URI::Escape; | |
use Web::Scraper; | |
use Data::Dumper; |
This file contains hidden or 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
install node.js v0.4.11 && install npm | |
[参照]「node.js」 http://nodejs.jp/nodejs.org_ja/docs/v0.4/ | |
[参照]「Building and Installing Node.js - GitHub」 https://github.com/joyent/node/wiki/Installation | |
# ここから | |
$ git clone --depth 1 git://github.com/joyent/node.git | |
$ cd node | |
$ git checkout v0.4.11 | |
$ export JOBS=2 |
This file contains hidden or 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 fs = require('fs'); | |
var path = require('path'); | |
var http = require('http'); | |
// リンク先は .mp3 ファイル | |
var options = { | |
method : 'GET', | |
host : 'm.friendfeed-media.com', | |
port : '80', | |
path : '/0c5e82d9e6a0d5e60a1a85609adbe0e7f02976a6' |
This file contains hidden or 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 url = require('url'); | |
var http = require('http'); | |
var path = require('path'); | |
// httpRequest('POST', 'http://xxx.com/post', { 'connection' : 'keep-alive' }, "mode=write&data=foo", function (res, req) { | |
// console.log(res.statusCode); | |
// console.log(JSON.stringify(res.headers)); | |
// console.log(JSON.stringify(req)); | |
// | |
// var data = ''; |
This file contains hidden or 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 HttpClient = require('../lib/httpClient.js').HttpClient; | |
var client = new HttpClient (); | |
var body = require('querystring').stringify({ | |
mode : 'login', pixiv_id : 'your pixiv id', pass : 'your pixiv pass' | |
}); | |
var pixivHome = 'http://www.pixiv.net'; | |
var loginPhp = [ pixivHome, '/login.php' ].join(''); |
This file contains hidden or 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 http = require('http'), | |
url = require('url'); | |
var _version = '0.001'; // 2011.10.03 | |
function HTTPClient (config) { | |
config = config || {}; | |
var storage = {}; | |
this['redirect'] = config['redirect'] || false; // redirect: not ok |
This file contains hidden or 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
// https://gist.github.com/1258811 のサンプル | |
var HTTPClient = require('./lib/http/client.js').HTTPClient; | |
var body = require('querystring').stringify({ | |
mode : 'login', pixiv_id : 'your pixiv id', pass : 'your pixiv pass' | |
}); | |
try { |
This file contains hidden or 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 sum = function () { | |
for (var v = 0,i = 0,l = arguments.length; i < l; v += arguments[i++]); return v; | |
}; | |
console.log(sum(2,3,4)); // 9 | |
// これは部分適用というらしい | |
if (! Function.prototype.papply) { | |
Function.prototype.papply = function () { | |
var slice = Array.prototype.slice, |
This file contains hidden or 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
// 部分適用メソッド | |
if (! Function.prototype.papply) { | |
Function.prototype.papply = function (thisObject, args) { | |
var slice = Array.prototype.slice; | |
var func = this; | |
return function () { | |
args = args.concat(slice.apply(arguments)); | |
return func.apply(thisObject, args); | |
}; | |
}; |