Skip to content

Commit

Permalink
Added submodules, fixed a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
peol committed Feb 25, 2012
1 parent f41fae3 commit 344d639
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 11 deletions.
15 changes: 15 additions & 0 deletions .gitmodules
@@ -0,0 +1,15 @@
[submodule "node_modules/Jerk"]
path = node_modules/Jerk
url = git://github.com/gf3/Jerk.git
[submodule "node_modules/node-bitly"]
path = node_modules/node-bitly
url = git://github.com/tanepiper/node-bitly.git
[submodule "node_modules/node-github"]
path = node_modules/node-github
url = git://github.com/ajaxorg/node-github.git
[submodule "node_modules/node-spotify"]
path = node_modules/node-spotify
url = git://github.com/peol/node-spotify.git
[submodule "node_modules/ntwitter"]
path = node_modules/ntwitter
url = git://github.com/AvianFlu/ntwitter.git
8 changes: 3 additions & 5 deletions modules/bitly.js
@@ -1,5 +1,5 @@
var functions = require('../functions'),
Bitly = require('node-bitly').Bitly,
Bitly = require('node-bitly'),
urlp = require('url'),
hollabacks,
bitly;
Expand Down Expand Up @@ -31,15 +31,13 @@ bitly = module.exports = {
this._sh = socialhapy;

var credentials = socialhapy.config.modules.bitly;

this._bitly = new Bitly(credentials.user, credentials.token);

functions.extend(socialhapy.watchers, this.watchers);
},

createLink: function(url, hollaback) {
this._bitly.shorten(url, function(result) {
if ( !result.data.url ) {
this._bitly.shorten(url, function(err, result) {
if ( err || !result.data.url ) {
console.log('*** Warning: bit.ly module encountered an error while shortening a link: ' + result.status_txt);
}

Expand Down
1 change: 1 addition & 0 deletions node_modules/Jerk
Submodule Jerk added at 68c026
1 change: 1 addition & 0 deletions node_modules/node-bitly
Submodule node-bitly added at 519909
1 change: 1 addition & 0 deletions node_modules/node-github
Submodule node-github added at d19cb1
1 change: 1 addition & 0 deletions node_modules/node-spotify
Submodule node-spotify added at 7dc11e
1 change: 1 addition & 0 deletions node_modules/ntwitter
Submodule ntwitter added at 18efc6
17 changes: 11 additions & 6 deletions socialhapy.js
Expand Up @@ -59,13 +59,18 @@ function initialize() {
config.irc.channels = functions.unique( ircChans );

// Connect to IRC
Jerk(function(jerk) {
socialhapy.jerk = jerkInstance = jerk;
(function() {
var staticJerk = Jerk(function(jerk) {
socialhapy.jerk = jerkInstance = jerk;

for (o in watchers) {
functions.addWatcher( jerkInstance, watchers[ o ] );
}
}).connect( config.irc );
for (o in watchers) {
functions.addWatcher( jerkInstance, watchers[ o ] );
}
})
.connect( config.irc );

jerkInstance.say = staticJerk.say;
})();
}

initialize();

0 comments on commit 344d639

Please sign in to comment.