Skip to content

Instantly share code, notes, and snippets.

@paul-english
Created January 15, 2012 01:53
Show Gist options
  • Save paul-english/1613857 to your computer and use it in GitHub Desktop.
Save paul-english/1613857 to your computer and use it in GitHub Desktop.
# https://github.com/DanielRapp/twss.js
# https://github.com/jdub/node-twitter
twitter = require("twitter")
twss = require("twss")
twit = new twitter(
consumer_key: ""
consumer_secret: ""
access_token_key: ""
access_token_secret: ""
)
twit.stream "user",
track: "nrub"
, (stream) ->
stream.on "data", (data) ->
if data.text
if twss.is(data.text)
response = "@" +
data.user.screen_name +
", That's what she said."
twit.updateStatus response, (data) ->
console.log data
console.log response
require 'rubygems'
require 'twitter'
require 'tweetstream'
require 'twss'
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
TweetStream.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
config.auth_method = :oauth
config.parser = :yajl
end
TweetStream::Client.new.userstream do |status|
puts status.text
if status.text
Twitter.update("That's what she said!") if TWSS(status.text)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment