Skip to content

Commit

Permalink
fixed path
Browse files Browse the repository at this point in the history
  • Loading branch information
jbilcke committed Jun 1, 2012
1 parent b7428d2 commit 994e272
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
8 changes: 6 additions & 2 deletions examples/twitter/demo1.coffee
@@ -1,20 +1,24 @@
#!/usr/bin/env coffee

Hydrant = require '../../lib/hydrant'
Hydrant = require 'hydrant'
{inspect} = require 'util'
hydrant = new Hydrant
defaults:
encoding: no # yaml, json, none
compress: no # deflateRaw, deflate, gzip, or none

twitter:
module: '../../lib/input/twitter'
module: './input/twitter'

consumer_key: 'CONSUMER_KEY'
consumer_secret: 'CONSUMER_SECRET'
access_token_key: 'ACCESS_TOKEN_KEY'
access_token_secret: 'ACCES_TOKEN_SECRET'

endpoint: 'statuses/filter' # or 'statuses/sample' (remove 'search' in this case)
search:
track: 'node,javascript,clojure'

# you can pass conditions to ignore some entries of the flow
# warning: they are directly executed by Node, so be sure
# your Hydrant config file come from a trusted source!
Expand Down
6 changes: 5 additions & 1 deletion lib/input/twitter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -5,7 +5,7 @@
"email" : "julian.bilcke@daizoru.com",
"url" : "http://github.com/daizoru"
},
"name": "node-hydrant",
"name": "hydrant",
"description": "Complex event stream aggregator and broadcaster",
"version": "0.0.0",
"repository": {
Expand All @@ -14,7 +14,7 @@
},
"directories" : {
"lib" : "./lib",
"example" : "./example",
"examples" : "./examples",
"test" : "./test"
},
"main" : "./lib/hydrant",
Expand Down
11 changes: 10 additions & 1 deletion src/input/twitter.coffee
Expand Up @@ -30,16 +30,25 @@ ntwitter = require 'ntwitter'
class module.exports

constructor: (@config) ->
@endpoint = 'statuses/sample'
if @config.endpoint?
@endpoint = @config.endpoint

@search = undefined
if @config.search?
@search = @config.search

@filters = []
if @config.ignores?
for ignore in @config.ignores
@filters.push ignore
delete @config['ignores']
@twitter = new ntwitter @config


start: =>
# rate limit: 400 keywords, 5,000 follow userids
@twitter.stream 'statuses/sample', undefined, (s) =>
@twitter.stream @endpoint, @search, (s) =>

process = (data) =>
#console.log "data: #{inspect data}"
Expand Down

0 comments on commit 994e272

Please sign in to comment.