{"id":13906256,"url":"https://github.com/oscarmorrison/nightmare-heroku","last_synced_at":"2025-03-21T22:31:36.780Z","repository":{"id":71204190,"uuid":"94024606","full_name":"oscarmorrison/nightmare-heroku","owner":"oscarmorrison","description":"😱 a setup for nightmarejs on heroku","archived":false,"fork":false,"pushed_at":"2019-05-07T12:22:21.000Z","size":17,"stargazers_count":46,"open_issues_count":0,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-01T10:21:37.348Z","etag":null,"topics":["heroku","nightmare","nightmarejs","node","scary","scraper"],"latest_commit_sha":null,"homepage":"http://blog.oscarmorrison.com/nightmarejs-on-heroku-the-ultimate-scraping-setup/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oscarmorrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-11T18:44:45.000Z","updated_at":"2024-10-10T10:57:54.000Z","dependencies_parsed_at":"2023-06-27T00:24:43.602Z","dependency_job_id":null,"html_url":"https://github.com/oscarmorrison/nightmare-heroku","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarmorrison%2Fnightmare-heroku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarmorrison%2Fnightmare-heroku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarmorrison%2Fnightmare-heroku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarmorrison%2Fnightmare-heroku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarmorrison","download_url":"https://codeload.github.com/oscarmorrison/nightmare-heroku/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244165104,"owners_count":20409039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["heroku","nightmare","nightmarejs","node","scary","scraper"],"created_at":"2024-08-06T23:01:32.100Z","updated_at":"2025-03-21T22:31:36.773Z","avatar_url":"https://github.com/oscarmorrison.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/1651212/27013967-6cbd6b8a-4ebc-11e7-9cd8-e5d0fcb01440.png\" alt=\"logo\" width=\"600px\" /\u003e\n \u003c/p\u003e\n\n\n# NightmareJS on Heroku \u003ca href=\"https://heroku.com/deploy\" target=\"_blank\"\u003e\u003cimg src=\"https://www.herokucdn.com/deploy/button.svg\" alt=\"Heroku deploy\" align=\"right\"\u003e\u003c/a\u003e\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/oscarmorrison/nightmare-heroku/issues)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=plastic)](https://github.com/oscarmorrison/nightmare-heroku/blob/master/LICENSE)  [![GitHub issues](https://img.shields.io/github/issues/oscarmorrison/nightmare-heroku.svg)](https://github.com/oscarmorrison/nightmare-heroku/issues)\n\n\n## Intro\n\n[NightmareJS](http://www.nightmarejs.org/) is an awesome highlevel webscraping and browser automation library built ontop of electron. This repo is a good starting place to be able to use it with some default setups ontop of heroku using the following instructions. [Read more](http://blog.oscarmorrison.com/nightmarejs-on-heroku-the-ultimate-scraping-setup/)\n\n## Getting started\n- `git clone --depth 1 git@github.com:oscarmorrison/nightmare-heroku [new-project-name]`\n\n- `cd [new-project-name]`\n- `rm -rf .git`\n- `git init`\n- setup git remote repository on github.com from existing code\n```\ngit remote add origin git@github.com:[username]/[new-project-name].git\ngit add -A\ngit commit -m \"Initial commit\"\ngit push -u origin master\n```\n- `heroku create`\n- `heroku stack:set cedar-14`\n- set build packs\n```\nheroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt \u0026\u0026\nheroku buildpacks:add --index 2 https://github.com/captain401/heroku-buildpack-xvfb.git \u0026\u0026\nheroku buildpacks:add --index 3 https://github.com/causztic/heroku-electron-buildpack.git \u0026\u0026\nheroku buildpacks:add --index 4 https://github.com/heroku/heroku-buildpack-nodejs.git\n```\n- `git push heroku master`\n- goto heroku dashboard and select created app; install `Heroku Scheduler` add-on\n- `heroku ps:scale web=0`\n- `node ./index.js` to verify nightmare runs correctly locally; npm install needs to be run. The following output should be seen.\n```\nWelcome to Nightmare scrape\n==========\nNightmareJS on Heroku the ultimate scraping setup\n=========\nAll done\n```\n- Open heroku app from heroku dashboard. 'Application error' is displayed because no routes have been defined yet so this is normal in this case. \n- `heroku logs` to check output for any errors. If everything went well, near the bottom of the output the 'Welcome to Nightmare scrape' messages as displayed above should appear. Now, you can work on the rest of your code knowing that nightmarejs will work on heroku as it works locally.\n\n### Debugging\n```heroku run DEBUG=nightmare:*,electron:* xvfb-run --auto-servernum --server-args=\"-screen 0 1024x768x24\" node --harmony index.js\n```\n### Other\n\nYou may need to set a engines in package.json:\n```\n\"engines\": {\n      \"node\": \"8.11.4\"\n  },\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarmorrison%2Fnightmare-heroku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarmorrison%2Fnightmare-heroku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarmorrison%2Fnightmare-heroku/lists"}