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
module TwitterOAuth | |
class Client | |
def get_lists(user) | |
get("/lists/list.json?screen_name=#{user}") | |
end | |
end | |
end | |
module Earthquake::Input | |
def lists |
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
module TwitterOAuth | |
class Client | |
def update_profile(params) | |
post("/account/update_profile.json", params) | |
end | |
end | |
end | |
Earthquake.init do | |
%w[name description url location].each do |word| |
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 "date" | |
Earthquake.init do | |
_ = config[:fav_machine] ||= {} | |
_[:dir] ||= File.expand_path("./fav_machine", config[:dir]) | |
_[:screen_names] ||= [twitter.info["screen_name"]] | |
FileUtils.mkdir_p(_[:dir]) unless Dir.exist? _[:dir] | |
output_filter do |item| | |
if item["event"] == "favorite" && config[:fav_machine][:screen_names].include?(item["source"]["screen_name"]) |
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
Earthquake.init do | |
_ = config[:auto_restart] ||= {} | |
_[:interval] ||= 60 * 60 | |
system "stty echo" # for readline | |
EM.defer do | |
sleep config[:auto_restart][:interval] | |
loop do | |
if Readline.line_buffer.nil? || Readline.line_buffer.empty? |
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
#!/usr/bin/env ruby | |
module Temperature | |
refine Numeric do | |
def to_fahr | |
self.to_f * 9 / 5 + 32 | |
end | |
def to_cels | |
(self.to_f - 32) * 5 / 9 |
NewerOlder