Open ORESoftware opened 8 years ago
yes you are. The nmp repo https://www.npmjs.com/package/twitter-node-client is outdated.
@BoyCook Any plans to release an updated version?
The npm package is still outdated.
The current master on GitHub has
function Twitter() {
var configPath = "data/twitter_config";
try {
var config = process.env;
this.consumerKey = config.twitterConsumerKey;
this.consumerSecret = config.twitterConsumerSecret;
this.accessToken = config.twitterAccessToken;
this.accessTokenSecret = config.twitterAccessTokenSecret;
this.callBackUrl = config.twitterCallBackUrl;
this.baseUrl = 'https://api.twitter.com/1.1';
this.oauth = new OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
this.consumerKey,
this.consumerSecret,
'1.0',
this.callBackUrl,
'HMAC-SHA1'
);
} catch (err) {
//console.log(err)
console.log("no 'data/twitter_config' file, continuing without...");
}
}
whereas the nom package has
function Twitter(config) {
this.consumerKey = config.consumerKey;
this.consumerSecret = config.consumerSecret;
this.accessToken = config.accessToken;
this.accessTokenSecret = config.accessTokenSecret;
this.callBackUrl = config.callBackUrl;
this.baseUrl = 'https://api.twitter.com/1.1';
this.oauth = new OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
this.consumerKey,
this.consumerSecret,
'1.0',
this.callBackUrl,
'HMAC-SHA1'
);
}
I would have installed the package earlier if I knew the config file wasn't the only way to pass params to the function.
for example,
twitter.postMedia is not in the NPM repo
am I right?