jugyo-termtter 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Manifest.txt CHANGED
@@ -3,6 +3,8 @@ Manifest.txt
3
3
  PostInstall.txt
4
4
  README.rdoc
5
5
  Rakefile
6
+ run_termtter.rb
7
+ example_dot_termtter
6
8
  bin/termtter
7
9
  lib/termtter.rb
8
10
  lib/termtter/stdout.rb
data/README.rdoc CHANGED
@@ -21,9 +21,16 @@ Run:
21
21
 
22
22
  == INSTALL:
23
23
 
24
- sudo gem source -a http://gems.github.com
24
+ sudo gem source -a http://gems.github.com (you only have to do this once)
25
25
  sudo gem install jugyo-termtter
26
26
 
27
+ create configuration file named '.termtter' in your HOME directory.
28
+
29
+ vim ~/.termtter
30
+
31
+ configatron.user_name = 'USERNAME'
32
+ configatron.password = 'PASSWORD'
33
+
27
34
  == LICENSE:
28
35
 
29
36
  (The MIT License)
data/bin/termtter CHANGED
@@ -2,14 +2,7 @@
2
2
 
3
3
  $KCODE = 'u'
4
4
 
5
- self_file =
6
- if File.ftype(__FILE__) == 'link'
7
- File.readlink(__FILE__)
8
- else
9
- __FILE__
10
- end
11
- $:.unshift(File.dirname(self_file) + "/../lib")
12
-
5
+ require 'rubygems'
13
6
  require 'termtter'
14
7
  require 'termtter/standard_commands'
15
8
  require 'termtter/stdout'
@@ -30,4 +23,3 @@ EOS
30
23
  end
31
24
 
32
25
  Termtter::Client.run
33
-
@@ -0,0 +1,10 @@
1
+ #require 'termtter/english'
2
+ #require 'termtter/say'
3
+ #require 'termtter/notify-send'
4
+ #require 'termtter/uri-open'
5
+ #require 'termtter/growl'
6
+
7
+ configatron.user_name = 'USERNAME'
8
+ configatron.password = 'PASSWORD'
9
+ #configatron.update_interval = 120
10
+
@@ -1,15 +1,16 @@
1
1
  Termtter::Client.add_hook do |statuses, event|
2
2
  if !statuses.empty? && event == :update_friends_timeline
3
3
  max = 10
4
-
4
+
5
5
  text = statuses[0..(max - 1)].map{|s|
6
- status_text = s.text.gsub(%r{https?://[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+},'<a href="\0">\0</a>')
6
+ status_text = CGI.escapeHTML(s.text)
7
+ status_text.gsub!(%r{https?://[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+},'<a href="\0">\0</a>')
7
8
  status_text.gsub!("\n", '')
8
9
  "<b>#{s.user_screen_name}:</b> <span font=\"9.0\">#{status_text}</span>"
9
10
  }.join("\n")
10
-
11
+
11
12
  text += "\n<a href=\"http://twitter.com/\">more…</a>" if statuses.size > max
12
-
13
+
13
14
  system 'notify-send', 'Termtter', text, '-t', '60000'
14
15
  end
15
16
  end
data/lib/termtter.rb CHANGED
@@ -10,7 +10,7 @@ $:.unshift(File.dirname(__FILE__)) unless
10
10
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
11
11
 
12
12
  module Termtter
13
- VERSION = '0.5.0'
13
+ VERSION = '0.5.1'
14
14
 
15
15
  class Twitter
16
16
 
data/run_termtter.rb ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $KCODE = 'u'
4
+
5
+ self_file =
6
+ if File.ftype(__FILE__) == 'link'
7
+ File.readlink(__FILE__)
8
+ else
9
+ __FILE__
10
+ end
11
+ $:.unshift(File.dirname(self_file) + "/lib")
12
+
13
+ require 'termtter'
14
+ require 'termtter/standard_commands'
15
+ require 'termtter/stdout'
16
+ require 'configatron'
17
+
18
+ conf_file = File.expand_path('~/.termtter')
19
+ if File.exist? conf_file
20
+ load conf_file
21
+ else
22
+ puts '~/.termtter not found.'
23
+ exit 1
24
+ end
25
+
26
+ Termtter::Client.run
27
+
28
+ # Startup scripts for development
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jugyo-termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -57,6 +57,8 @@ files:
57
57
  - PostInstall.txt
58
58
  - README.rdoc
59
59
  - Rakefile
60
+ - run_termtter.rb
61
+ - example_dot_termtter
60
62
  - bin/termtter
61
63
  - lib/termtter.rb
62
64
  - lib/termtter/stdout.rb