lewagon/nightmare-boilerplate

Name: nightmare-boilerplate

Owner: Le Wagon

Description: null

Created: 2015-06-17 12:54:20.0

Updated: 2018-02-15 16:22:31.0

Pushed: 2016-03-28 19:28:39.0

Homepage: http://ondemand.lewagon.org/tracks/comprenez-enfin-javascript/go

Size: 3

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NightmareJS Boilerplate bot

You need Node.js and Phantom.js installed on your computer. You also need git, a Heroku account and the Heroku toolbelt.

Version

This boilerplate works with version 1.8 of Nightmare JS, not the newest 2.x version. To get the documentation of the 1.8 version, follow this link.

Getting started

First, download this repository ZIP.

Unzip it, and move the folder from your Download repository to where you usually code. Open the folder in the terminal (you can cd to it). Once in that folder, run:

t init
t commit -m "Starting from @lewagon's boilerplate"
m install

We need this folder to be a git repository as we're going to deploy it to Heroku.

You can push this repo to GitHub if you wish to share your work or make a backup. Just go to this page. You can also use the Mac client or the Windows client.

Start coding

Open script.js in Sublime Text, and write some JavaScript code. You can then test your script with the terminal:

de script.js
 for more debugging power:
BUG=nightmare node script.js

When you are happy with your code, do not forget to commit it!

t add script.js
t commit -m "A description of what I just did."

(Take 10 seconds to think of meaningful commit messages, it's very important)

Deploy and run on Heroku

First create a Heroku app for your bot.

roku create --region=eu --buildpack=https://github.com/ddollar/heroku-buildpack-multi.git

Then, to deploy it (after some commits), just run:

t push heroku master

To run the bot on Heroku, just prefix the command you run locally with heroku run. For instance, you get:

roku run node script.js

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.