Closed DhruvAerosol closed 7 years ago
var ApiBuilder = require('claudia-api-builder'), api = new ApiBuilder(); var Twitter = require('twitter'); var twitterAPI = require('node-twitter-api'); var path = require('path'); var jsonfile = require('jsonfile') var url = require('url'); var superb = require('superb'); var Promise = require("bluebird"); api.get("/request-token", function(request) { 'use strict'; var file = 'secret.json'; var secret = 1; jsonfile.readFile(file, function(err, obj) { console.log("err: "+err); console.log("json: "+obj); secret = obj; }); new Promise(function (resolve) { var twitter = new twitterAPI({ consumerKey: "ckey", consumerSecret: "cskey", callback: 'http://localhost:3000/access-token' }); var res; twitter.getRequestToken(function(err, requestToken, requestSecret) { console.log("err "+JSON.stringify(err)); console.log("requestToken "+JSON.stringify(requestToken)); if (err) res = err; else { var _requestSecret = requestSecret; console.log("key "+secret.twitter.consumer_key); console.log("url: "+url); var url = "https://twitter.com/oauth/authenticate?oauth_token"+requestToken; res = url; //console.log(twitter.getAuthUrl(requestToken)); //res.redirect(url); } }); return res; }); });
please don't use github issues for generic questions. we have a chat channel for that.