Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: lib/plugins/defaults/stdout.rb
- Loading branch information
Showing
104 changed files
with
1,356 additions
and
384 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.7.2 | ||
1.8.0 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
config.access_token = '' | ||
config.access_token_secret = '' | ||
|
||
module OAuth | ||
class AccessToken | ||
def initialize(consumer, access_token, access_token_secret) | ||
end | ||
end | ||
end | ||
module Termtter | ||
class RubytterProxy | ||
def initialize(access_token, twitter_option) | ||
user_name = config.plugins.basic.user_name | ||
password = config.plugins.basic.password | ||
@rubytter = Rubytter.new(user_name, password, twitter_option) | ||
end | ||
end | ||
end | ||
|
||
# basic.rb | ||
# Use Basic Auth instead of OAuth | ||
# | ||
# config.plugins.basic.user_name = 'your_name' | ||
# config.plugins.basic.password = 'the secret' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
config.plugins.copy.set_default(:style, "@<%= t.user.screen_name %>: <%= t.text %> [ <%= url %> ]") | ||
|
||
def copy_to_clipboard(str) | ||
if /darwin/i =~ RUBY_PLATFORM | ||
IO.popen("pbcopy", "w") do |io| | ||
io.print str | ||
end | ||
else | ||
puts "Sorry, this plugin is only in Mac OS X." | ||
end | ||
str | ||
end | ||
|
||
Termtter::Client.plug 'url' | ||
|
||
Termtter::Client.register_command(:name => :copy, | ||
:exec => lambda do |arg| | ||
t = Termtter::API.twitter.show(arg) | ||
url = url_by_tweet(t) | ||
erbed_text = ERB.new(config.plugins.copy.style).result(binding) | ||
|
||
puts "Copied=> #{copy_to_clipboard(erbed_text)}" | ||
end) | ||
|
||
Termtter::Client.register_command(:name => :copy_url, | ||
:exec => lambda do |arg| | ||
t = Termtter::API.twitter.show(arg) | ||
url = url_by_tweet(t) | ||
|
||
puts "Copied=> #{copy_to_clipboard(url)}" | ||
|
||
end) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'pp' | ||
|
||
module Termtter::Client | ||
register_command( | ||
:name => :"cache stats", | ||
:help => ['cache stats', 'Show Memcached stats.'], | ||
:exec_proc => lambda {|arg| | ||
puts memory_cache.stats.pretty_inspect | ||
}) | ||
|
||
register_command( | ||
:name => :"cache flush", | ||
:help => ['cache flush', 'Flush all caches.'], | ||
:exec_proc => lambda {|arg| | ||
memory_cache.flush_all | ||
logger.info "cache flushed." | ||
}) | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
def fib(n)i=0;j=1;n.times{j=i+i=j};i end | ||
Termtter::Client.register_command(:fib) do |arg| | ||
n = arg.to_i | ||
text = "fib(#{n}) = #{fib n}" | ||
Termtter::API.twitter.update(text) | ||
puts "=> " << text | ||
end | ||
Termtter::Client.register_command(:name => :fib, | ||
:aliases => [:f, :ho], | ||
:exec => lambda do |arg| | ||
case arg | ||
when "ukumori" | ||
puts 'Does it mean "Sora Harakami (@sora_h)"?' | ||
when "ootsuite", "otsuite" | ||
puts "NDA :D" | ||
else | ||
n = arg.to_i | ||
text = "fib(#{n}) = #{fib n}" | ||
Termtter::API.twitter.update(text) | ||
puts "=> " << text | ||
end | ||
end) |
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
Oops, something went wrong.