Skip to content

Instantly share code, notes, and snippets.

@sanemat
Created June 9, 2012 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanemat/2901922 to your computer and use it in GitHub Desktop.
Save sanemat/2901922 to your computer and use it in GitHub Desktop.
sample_stream plugin for Earthquake
# coding: utf-8
# see https://dev.twitter.com/docs/api/1/get/statuses/sample
Earthquake.init do
sample_stream = {
method: "GET",
host: "stream.twitter.com",
path: "/1/statuses/sample.json",
ssl: true,
}
command :sample do
config[:api] = sample_stream
reconnect
end
command %r!^:sample off$!, as: :sample do
input(":filter off")
end
help :sample, "switches public streams", <<-HELP
⚡ :sample
⚡ :sample off
HELP
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment