This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//importing Twitter JS Client dependancy | |
module.exports = require('./lib/Twitter'); | |
// VARIBALES | |
var express = require('express'); | |
var OAuth2 = require('oauth').OAuth2; | |
var https = require('https'); | |
var app = express(); | |
var bodyParser = require('body-parser'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TwitterService will now look like this | |
app.factory('TwitterService', function($http, $q){ | |
var createTweet = function(tweet){ | |
//we need to URL encode our string. | |
var urlEncodedTweet = encodeURI(tweet); | |
var d = $q.defer(); | |
$http.post('/twitter/tweet', {tweet: urlEncodedTweet}) | |
.success(function(data){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"node": true, | |
"browser": true, | |
"esnext": true, | |
"bitwise": true, | |
"camelcase": true, | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"indent": 4, |