Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created August 7, 2013 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/6173008 to your computer and use it in GitHub Desktop.
Save hitode909/6173008 to your computer and use it in GitHub Desktop.
CasperJSで診断メーカーする
#! /usr/bin/env casperjs
# ./shindan_casper.coffee '趣味はマリンスポーツです'
casper = do (require 'casper').create
casper.start 'http://shindanmaker.com/c/list?mode=hot', ->
href = @evaluate ->
links = (document.querySelectorAll '.list_title')
links[Math.floor (do Math.random * links.length)].href
casper.open href
casper.then ->
@echo @getTitle()
casper.fill '#form',
u: casper.cli.args[0]
@click '#form input[type="submit"]'
casper.then ->
result = @evaluate ->
document.querySelector('#forcopy textarea').value
@echo result
do casper.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment