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 Lwp, urls; | |
var urls = [ | |
'http://qiita.com/', | |
'https://github.com/', | |
'http://www.yahoo.co.jp/' | |
]; | |
Lwp = function(urls, callbackPerUrl, callbackFinal){ | |
var next, page, retrieve, urlIndex, webpage; |
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 url = 'http://www.yahoo.co.jp/'; | |
var page = require('webpage').create(); | |
page.settings.userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A344 Safari/601.1'; | |
page.open(url, function() { | |
page.render('screen.png'); | |
phantom.exit(); | |
}); |
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 webPage = require('webpage'); | |
var page = webPage.create(); | |
page.open('http://www.mwed.jp/hall/16238/', function(status) { | |
var pageName = page.evaluateJavaScript('function(){return s.pageName;}'); | |
console.log(pageName); | |
phantom.exit(); | |
}); |
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 page = require('webpage').create(); | |
page.open('http://tabelog.com/tokyo/A1301/A130101/13142530/', function() { | |
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { | |
var og_title = page.evaluate(function() { | |
return $("meta[property='og:title']").attr("content"); | |
}); | |
console.log(og_title); | |
phantom.exit(); | |
}); |
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 page = require('webpage').create(); | |
page.open('http://tabelog.com/tokyo/A1301/A130101/13142530/', function() { | |
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { | |
var og_title = page.evaluate(function() { | |
return $("meta[property='og:title']").attr("content"); | |
}); | |
console.log(og_title); | |
phantom.exit(); | |
}); |
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 page = require('webpage').create(); | |
page.open('http://github.com/', function() { | |
page.render('github.png'); | |
phantom.exit(); | |
}); |
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 url = phantom.args[0] || 'http://www.yahoo.co.jp/'; | |
page = new WebPage(); | |
page.open(url, function(stat){ | |
if(!stat){ | |
phantom.exit(); | |
} | |
else{ | |
var title = page.evaluate(function(){ | |
return document.title; |
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
module.exports = (robot) -> | |
github = require('githubot')(robot) | |
robot.router.post '/github', (req, res) -> | |
room = 'general' | |
issue = req.body.issue ? req.body.pull_request | |
type = if req.body.pull_request then 'Pull Request' else 'issue' | |
if req.body.action in ['unlabeled'] |
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
module.exports = (robot) -> | |
github = require('githubot')(robot) | |
robot.router.post '/github', (req, res) -> | |
room = 'general' | |
issue = req.body.issue ? req.body.pull_request | |
type = if req.body.pull_request then 'Pull Request' else 'issue' | |
assignee = if issue.assignee then issue.assignee.login else 'No Aassignee' |