How to post tweet on Twitter using NightmareJS
NightmareJS is nice replacement of CasperJS and PhantomeJS, it comes with simple API.
Here is a example of how to post a tweet on Twitter
var Nightmare = require('nightmare');
var vo = require('vo');
vo(function* () {
var nightmare = Nightmare({ show: true });
var link = yield nightmare
.goto('http://twitter.com/intent/tweet')
.type('#status', "Insert tweet here")
.type('#username_or_email', "Insert email here")
.type('#password', "Insert password here")
.click('.button')
yield nightmare.end();
})(function (err, result) {
if (err) return console.log(err);
});
If you want to hide the chromium window just change to show
property to false
.
Written by Younes
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Automation
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#