Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Misc cleanup

  • Loading branch information...
commit 59631f958e787d2c98bcd74b14a047af2f1ab4ec 1 parent c314b1d
Darcy Laycock authored
Showing with 5 additions and 7 deletions.
  1. +4 −5 lib/pebble/twitter.js
  2. +1 −2  src/pebble/twitter.coffee
9 lib/pebble/twitter.js
View
@@ -18,15 +18,14 @@
}
Twitter.prototype.name = "twitter";
Twitter.prototype.setup = function() {
- var config, outer;
+ var config;
config = this.config();
- this.twitter = new NTwitter({
+ return this.twitter = new NTwitter({
consumer_key: config.consumer.key,
consumer_secret: config.consumer.secret,
access_token_key: config.access_token.key,
access_token_secret: config.access_token.secret
});
- return outer = this;
};
Twitter.prototype.startStream = function() {
var outer;
@@ -34,9 +33,9 @@
return this.twitter.stream('statuses/filter', {
track: config.track
}, __bind(function(stream) {
- stream.on('data', __bind(function(tweet) {
+ stream.on('data', function(tweet) {
return outer.emit('tweet', outer.filtered(tweet));
- }, this));
+ });
stream.on('end', function(resp) {
var reconnect;
sys.puts("Twitter Connection ended, Status code was " + resp.statusCode);
3  src/pebble/twitter.coffee
View
@@ -14,12 +14,11 @@ class Twitter extends Base
access_token_key: config.access_token.key
access_token_secret: config.access_token.secret
})
- outer = @
startStream: ->
outer = this
@twitter.stream 'statuses/filter', track: config.track, (stream) =>
- stream.on 'data', (tweet) =>
+ stream.on 'data', (tweet) ->
outer.emit 'tweet', outer.filtered tweet
stream.on 'end', (resp) ->
sys.puts "Twitter Connection ended, Status code was #{resp.statusCode}"
Please sign in to comment.
Something went wrong with that request. Please try again.