Created
January 15, 2012 01:53
-
-
Save paul-english/1613857 to your computer and use it in GitHub Desktop.
This file contains 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
# 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 |
This file contains 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
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