Skip to content

Instantly share code, notes, and snippets.

@kamiyaowl
Created February 16, 2014 10:46
Show Gist options
  • Save kamiyaowl/9032355 to your computer and use it in GitHub Desktop.
Save kamiyaowl/9032355 to your computer and use it in GitHub Desktop.
heroku+node.jsテスト「呼ばれてない」
var http = require('http');
http.createServer(function(req,res){
res.writeHead(301,{'Location': 'http://twitter.com/kam1yan___'});
res.end();
t.updateStatus('誰か来た(n回目)', null, function (data) {
});
}).listen(process.env.PORT || 3333);
var twitter = require('twitter');
var util = require('util');
var t = new twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
});
t.stream('user', function (stream) {
stream.on('data', function (data) {
if (!('text' in data)) return;
if(data.text.match(/かみや|かみゃー|かみや氏|かみやたん/)){
t.updateStatus('呼ばれた気がする(n回目)', null, function (data) {
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment