consadole_aggregator 0.1.9 → 0.2.0

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/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rspec CHANGED
@@ -1 +1,2 @@
1
- --color --format documentation
1
+ --color
2
+ --format progress
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.3
data/.travis.yml ADDED
@@ -0,0 +1 @@
1
+ rvm: 1.9.3
data/Gemfile CHANGED
@@ -1,12 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "nokogiri"
4
- gem "oauth"
5
- gem "rubytter"
3
+ # Specify your gem's dependencies in consadole_aggregator.gemspec
4
+ gemspec
6
5
 
7
- group :development do
8
- gem "bundler"
9
- gem "rcov"
10
- gem "rspec"
11
- gem "jeweler"
12
- end
6
+ gem "rake"
data/Gemfile.lock CHANGED
@@ -1,37 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ consadole_aggregator (0.0.1)
5
+
1
6
  GEM
2
7
  remote: http://rubygems.org/
3
8
  specs:
4
- diff-lcs (1.1.2)
5
- git (1.2.5)
6
- jeweler (1.6.2)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- json (1.5.3)
11
- nokogiri (1.4.6)
12
- oauth (0.4.4)
13
- rake (0.9.2)
14
- rcov (0.9.9)
15
- rspec (2.6.0)
16
- rspec-core (~> 2.6.0)
17
- rspec-expectations (~> 2.6.0)
18
- rspec-mocks (~> 2.6.0)
19
- rspec-core (2.6.4)
20
- rspec-expectations (2.6.0)
21
- diff-lcs (~> 1.1.2)
22
- rspec-mocks (2.6.0)
23
- rubytter (1.4.2)
24
- json (>= 1.1.3)
25
- oauth (>= 0.3.6)
9
+ activesupport (3.2.3)
10
+ i18n (~> 0.6)
11
+ multi_json (~> 1.0)
12
+ addressable (2.2.7)
13
+ diff-lcs (1.1.3)
14
+ eventmachine (0.12.10)
15
+ faraday (0.7.6)
16
+ addressable (~> 2.2)
17
+ multipart-post (~> 1.1)
18
+ rack (~> 1.1)
19
+ ffi (1.0.11)
20
+ guard (1.0.1)
21
+ ffi (>= 0.5.0)
22
+ thor (~> 0.14.6)
23
+ guard-rspec (0.7.0)
24
+ guard (>= 0.10.0)
25
+ httpclient (2.2.4)
26
+ i18n (0.6.0)
27
+ multi_json (1.2.0)
28
+ multipart-post (1.1.5)
29
+ nokogiri (1.5.2)
30
+ rack (1.4.1)
31
+ rake (0.9.2.2)
32
+ rspec (2.9.0)
33
+ rspec-core (~> 2.9.0)
34
+ rspec-expectations (~> 2.9.0)
35
+ rspec-mocks (~> 2.9.0)
36
+ rspec-core (2.9.0)
37
+ rspec-expectations (2.9.1)
38
+ diff-lcs (~> 1.1.3)
39
+ rspec-mocks (2.9.0)
40
+ ruby_gntp (0.3.4)
41
+ simple_oauth (0.1.5)
42
+ thor (0.14.6)
43
+ twitter (2.2.0)
44
+ activesupport (>= 2.3.9, < 4)
45
+ faraday (~> 0.7)
46
+ multi_json (~> 1.0)
47
+ simple_oauth (~> 0.1)
26
48
 
27
49
  PLATFORMS
28
50
  ruby
29
51
 
30
52
  DEPENDENCIES
31
- bundler
32
- jeweler
53
+ consadole_aggregator!
54
+ eventmachine
55
+ guard
56
+ guard-rspec
57
+ httpclient
33
58
  nokogiri
34
- oauth
35
- rcov
59
+ rake
36
60
  rspec
37
- rubytter
61
+ ruby_gntp
62
+ twitter
data/Guardfile ADDED
@@ -0,0 +1,19 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :version => 2 do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+
9
+ # Rails example
10
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
+ watch('config/routes.rb') { "spec/routing" }
15
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+ # Capybara request specs
17
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
18
+ end
19
+
data/Rakefile CHANGED
@@ -1,51 +1,5 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'rake'
11
-
12
- require 'jeweler'
13
- Jeweler::Tasks.new do |gem|
14
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
- gem.name = "consadole_aggregator"
16
- gem.homepage = "http://github.com/niku/consadole_aggregator"
17
- gem.license = "MIT"
18
- gem.summary = %Q{ It aggregates infomation of 'Consadole Sapporo' }
19
- gem.description = %Q{ It aggregates infomation of 'Consadole Sapporo' }
20
- gem.email = "niku@niku.name"
21
- gem.authors = ["niku"]
22
- # Include your dependencies below. Runtime dependencies are required when using your gem,
23
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
- # gem.add_development_dependency 'rspec', '> 1.2.3'
26
- end
27
- Jeweler::RubygemsDotOrgTasks.new
28
-
29
- require 'rspec/core'
30
- require 'rspec/core/rake_task'
31
- RSpec::Core::RakeTask.new(:spec) do |spec|
32
- spec.pattern = FileList['spec/**/*_spec.rb']
33
- spec.rspec_opts = '--format documentation'
34
- end
35
-
36
- RSpec::Core::RakeTask.new(:rcov) do |spec|
37
- spec.pattern = 'spec/**/*_spec.rb'
38
- spec.rcov = true
39
- end
1
+ require "bundler/gem_tasks"
40
2
 
3
+ require "rspec/core/rake_task"
4
+ RSpec::Core::RakeTask.new(:spec)
41
5
  task :default => :spec
42
-
43
- require 'rake/rdoctask'
44
- Rake::RDocTask.new do |rdoc|
45
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
-
47
- rdoc.rdoc_dir = 'rdoc'
48
- rdoc.title = "consadole_aggregator #{version}"
49
- rdoc.rdoc_files.include('README*')
50
- rdoc.rdoc_files.include('lib/**/*.rb')
51
- end
@@ -1,56 +1,36 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'consadole_aggregator'
3
+ require 'time'
2
4
  require 'optparse'
3
- params = ARGV.getopts(nil, "module:news", "output:log", "date:")
4
-
5
- $:.unshift(File.expand_path('../../lib', __FILE__)) if $0 == __FILE__
5
+ require 'twitter'
6
6
 
7
- require 'consadole_aggregator'
8
- require 'logger'
9
- path = File.expand_path('../../log', __FILE__) + '/exec_result.log'
10
- log = Logger.new(path)
7
+ module ConsadoleAggregator
8
+ opt = OptionParser.new
9
+ output = ->(post) { puts post }
10
+ opt.on('-o output', '--output output') { |o|
11
+ case o
12
+ when 'twitter'
13
+ Twitter.configure do |config|
14
+ config.consumer_key = ENV['CONSUMER_KEY']
15
+ config.consumer_secret = ENV['CONSUMER_SECRET']
16
+ config.oauth_token = ENV['OAUTH_TOKEN']
17
+ config.oauth_token_secret = ENV['OAUTH_TOKEN_SECRET']
18
+ end
19
+ output = ->(post) { Twitter.update Helper.truncate_for_twitter(post[:title], { url: post[:url], hashtag: '#consadole' }) }
20
+ end
21
+ }
11
22
 
12
- output = case params['output']
13
- when 'log'
14
- puts "output to #{path}"
15
- ->(element){
16
- if element.kind_of?(ConsadoleAggregator::Live::Timeline)
17
- log.debug ConsadoleAggregator::Helper.concat(element.to_s, hashtag:'#consadole')
18
- else
19
- title, url = element[:title], element[:url]
20
- log.debug ConsadoleAggregator::Helper.concat(title, url:url, hashtag:'#consadole')
21
- end
22
- }
23
- when 'twitter'
24
- require 'oauth'
25
- require 'rubytter'
26
- path = File.expand_path('../../', __FILE__) + '/account.yaml'
27
- ACCOUNT = YAML.load_file(path)
28
- oauth = Rubytter::OAuth.new(ACCOUNT['consumer']['key'], ACCOUNT['consumer']['secret'])
29
- access_token = OAuth::AccessToken.new(oauth.create_consumer, ACCOUNT['access']['key'], ACCOUNT['access']['secret'])
30
- t = OAuthRubytter.new(access_token)
31
- ->(element){
32
- if element.kind_of?(ConsadoleAggregator::Live::Timeline)
33
- t.update ConsadoleAggregator::Helper.concat(element.to_s, hashtag:'#consadole')
34
- else
35
- title, url = element[:title], element[:url]
36
- t.update ConsadoleAggregator::Helper.concat(title, url:url, hashtag:'#consadole')
37
- end
38
- }
39
- end
23
+ subcommand = ARGV.shift
40
24
 
41
- case params['module']
42
- when 'news'
43
- modules = ConsadoleAggregator::News.constants.map{ |k| ConsadoleAggregator::News.const_get(k).new }
44
- modules.each do |m|
45
- log.info "start #{m}"
46
- begin
47
- m.update &output
48
- rescue
49
- log.error $!
50
- end
51
- log.info "end #{m}"
25
+ case subcommand
26
+ when 'news'
27
+ opt.parse!(ARGV)
28
+ News.run &output
29
+ when 'live'
30
+ starting_time = Time.parse(ARGV.shift)
31
+ opt.parse!(ARGV)
32
+ Live.run starting_time, { writer: output }
33
+ else
34
+ raise 'first argument must be "news" or "live"'
52
35
  end
53
- when 'live'
54
- reservation_time = params['date'] ? Time.parse(params['date']) : nil
55
- ConsadoleAggregator::Live.reserve(reservation_time).execute &output
56
36
  end
@@ -1,217 +1,29 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "consadole_aggregator/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{consadole_aggregator}
8
- s.version = "0.1.9"
6
+ s.name = "consadole_aggregator"
7
+ s.version = ConsadoleAggregator::VERSION
8
+ s.authors = ["niku"]
9
+ s.email = ["niku@niku.name"]
10
+ s.homepage = "https://github.com/niku/consadole_aggregator"
11
+ s.summary = %q{aggregates infomation of 'Consadole Sapporo'}
12
+ #s.description = %q{TODO: Write a gem description}
9
13
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["niku"]
12
- s.date = %q{2011-06-24}
13
- s.default_executable = %q{consadole_aggregator}
14
- s.description = %q{ It aggregates infomation of 'Consadole Sapporo' }
15
- s.email = %q{niku@niku.name}
16
- s.executables = ["consadole_aggregator"]
17
- s.extra_rdoc_files = [
18
- "LICENSE.txt",
19
- "README.rdoc"
20
- ]
21
- s.files = [
22
- ".document",
23
- ".rspec",
24
- "Gemfile",
25
- "Gemfile.lock",
26
- "LICENSE.txt",
27
- "README.rdoc",
28
- "Rakefile",
29
- "VERSION",
30
- "account.yaml",
31
- "bin/consadole_aggregator",
32
- "consadole_aggregator.gemspec",
33
- "db/.gitignore",
34
- "lib/consadole_aggregator.rb",
35
- "lib/consadole_aggregator/aggregatable.rb",
36
- "lib/consadole_aggregator/helper.rb",
37
- "lib/consadole_aggregator/live.rb",
38
- "lib/consadole_aggregator/live/timeline.rb",
39
- "lib/consadole_aggregator/news.rb",
40
- "log/.gitignore",
41
- "spec/consadole_aggregator/aggregatable_spec.rb",
42
- "spec/consadole_aggregator/helper_spec.rb",
43
- "spec/consadole_aggregator/live/timeline_spec.rb",
44
- "spec/consadole_aggregator/live_spec.rb",
45
- "spec/consadole_aggregator/news_spec.rb",
46
- "spec/ext/asahi.txt",
47
- "spec/ext/clubconsadole.txt",
48
- "spec/ext/consaburn.txt",
49
- "spec/ext/consaclub.txt",
50
- "spec/ext/consadolenews.txt",
51
- "spec/ext/consadolephotos.txt",
52
- "spec/ext/forzaconsadole.txt",
53
- "spec/ext/hochiyomiuri.txt",
54
- "spec/ext/jsgoalnews.txt",
55
- "spec/ext/jsgoalphotos.txt",
56
- "spec/ext/live/s674.html",
57
- "spec/ext/live/s674.html.1",
58
- "spec/ext/live/s674.html.10",
59
- "spec/ext/live/s674.html.100",
60
- "spec/ext/live/s674.html.101",
61
- "spec/ext/live/s674.html.102",
62
- "spec/ext/live/s674.html.103",
63
- "spec/ext/live/s674.html.104",
64
- "spec/ext/live/s674.html.105",
65
- "spec/ext/live/s674.html.106",
66
- "spec/ext/live/s674.html.107",
67
- "spec/ext/live/s674.html.108",
68
- "spec/ext/live/s674.html.109",
69
- "spec/ext/live/s674.html.11",
70
- "spec/ext/live/s674.html.110",
71
- "spec/ext/live/s674.html.111",
72
- "spec/ext/live/s674.html.112",
73
- "spec/ext/live/s674.html.113",
74
- "spec/ext/live/s674.html.114",
75
- "spec/ext/live/s674.html.115",
76
- "spec/ext/live/s674.html.116",
77
- "spec/ext/live/s674.html.117",
78
- "spec/ext/live/s674.html.118",
79
- "spec/ext/live/s674.html.119",
80
- "spec/ext/live/s674.html.12",
81
- "spec/ext/live/s674.html.120",
82
- "spec/ext/live/s674.html.13",
83
- "spec/ext/live/s674.html.14",
84
- "spec/ext/live/s674.html.15",
85
- "spec/ext/live/s674.html.16",
86
- "spec/ext/live/s674.html.17",
87
- "spec/ext/live/s674.html.18",
88
- "spec/ext/live/s674.html.19",
89
- "spec/ext/live/s674.html.2",
90
- "spec/ext/live/s674.html.20",
91
- "spec/ext/live/s674.html.21",
92
- "spec/ext/live/s674.html.22",
93
- "spec/ext/live/s674.html.23",
94
- "spec/ext/live/s674.html.24",
95
- "spec/ext/live/s674.html.25",
96
- "spec/ext/live/s674.html.26",
97
- "spec/ext/live/s674.html.27",
98
- "spec/ext/live/s674.html.28",
99
- "spec/ext/live/s674.html.29",
100
- "spec/ext/live/s674.html.3",
101
- "spec/ext/live/s674.html.30",
102
- "spec/ext/live/s674.html.31",
103
- "spec/ext/live/s674.html.32",
104
- "spec/ext/live/s674.html.33",
105
- "spec/ext/live/s674.html.34",
106
- "spec/ext/live/s674.html.35",
107
- "spec/ext/live/s674.html.36",
108
- "spec/ext/live/s674.html.37",
109
- "spec/ext/live/s674.html.38",
110
- "spec/ext/live/s674.html.39",
111
- "spec/ext/live/s674.html.4",
112
- "spec/ext/live/s674.html.40",
113
- "spec/ext/live/s674.html.41",
114
- "spec/ext/live/s674.html.42",
115
- "spec/ext/live/s674.html.43",
116
- "spec/ext/live/s674.html.44",
117
- "spec/ext/live/s674.html.45",
118
- "spec/ext/live/s674.html.46",
119
- "spec/ext/live/s674.html.47",
120
- "spec/ext/live/s674.html.48",
121
- "spec/ext/live/s674.html.49",
122
- "spec/ext/live/s674.html.5",
123
- "spec/ext/live/s674.html.50",
124
- "spec/ext/live/s674.html.51",
125
- "spec/ext/live/s674.html.52",
126
- "spec/ext/live/s674.html.53",
127
- "spec/ext/live/s674.html.54",
128
- "spec/ext/live/s674.html.55",
129
- "spec/ext/live/s674.html.56",
130
- "spec/ext/live/s674.html.57",
131
- "spec/ext/live/s674.html.58",
132
- "spec/ext/live/s674.html.59",
133
- "spec/ext/live/s674.html.6",
134
- "spec/ext/live/s674.html.60",
135
- "spec/ext/live/s674.html.61",
136
- "spec/ext/live/s674.html.62",
137
- "spec/ext/live/s674.html.63",
138
- "spec/ext/live/s674.html.64",
139
- "spec/ext/live/s674.html.65",
140
- "spec/ext/live/s674.html.66",
141
- "spec/ext/live/s674.html.67",
142
- "spec/ext/live/s674.html.68",
143
- "spec/ext/live/s674.html.69",
144
- "spec/ext/live/s674.html.7",
145
- "spec/ext/live/s674.html.70",
146
- "spec/ext/live/s674.html.71",
147
- "spec/ext/live/s674.html.72",
148
- "spec/ext/live/s674.html.73",
149
- "spec/ext/live/s674.html.74",
150
- "spec/ext/live/s674.html.75",
151
- "spec/ext/live/s674.html.76",
152
- "spec/ext/live/s674.html.77",
153
- "spec/ext/live/s674.html.78",
154
- "spec/ext/live/s674.html.79",
155
- "spec/ext/live/s674.html.8",
156
- "spec/ext/live/s674.html.80",
157
- "spec/ext/live/s674.html.81",
158
- "spec/ext/live/s674.html.82",
159
- "spec/ext/live/s674.html.83",
160
- "spec/ext/live/s674.html.84",
161
- "spec/ext/live/s674.html.85",
162
- "spec/ext/live/s674.html.86",
163
- "spec/ext/live/s674.html.87",
164
- "spec/ext/live/s674.html.88",
165
- "spec/ext/live/s674.html.89",
166
- "spec/ext/live/s674.html.9",
167
- "spec/ext/live/s674.html.90",
168
- "spec/ext/live/s674.html.91",
169
- "spec/ext/live/s674.html.92",
170
- "spec/ext/live/s674.html.93",
171
- "spec/ext/live/s674.html.94",
172
- "spec/ext/live/s674.html.95",
173
- "spec/ext/live/s674.html.96",
174
- "spec/ext/live/s674.html.97",
175
- "spec/ext/live/s674.html.98",
176
- "spec/ext/live/s674.html.99",
177
- "spec/ext/nikkansports.txt",
178
- "spec/spec.opts",
179
- "spec/spec_helper.rb"
180
- ]
181
- s.homepage = %q{http://github.com/niku/consadole_aggregator}
182
- s.licenses = ["MIT"]
183
- s.require_paths = ["lib"]
184
- s.rubygems_version = %q{1.6.2}
185
- s.summary = %q{It aggregates infomation of 'Consadole Sapporo'}
14
+ s.rubyforge_project = "consadole_aggregator"
186
15
 
187
- if s.respond_to? :specification_version then
188
- s.specification_version = 3
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
189
20
 
190
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
191
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
192
- s.add_runtime_dependency(%q<oauth>, [">= 0"])
193
- s.add_runtime_dependency(%q<rubytter>, [">= 0"])
194
- s.add_development_dependency(%q<bundler>, [">= 0"])
195
- s.add_development_dependency(%q<rcov>, [">= 0"])
196
- s.add_development_dependency(%q<rspec>, [">= 0"])
197
- s.add_development_dependency(%q<jeweler>, [">= 0"])
198
- else
199
- s.add_dependency(%q<nokogiri>, [">= 0"])
200
- s.add_dependency(%q<oauth>, [">= 0"])
201
- s.add_dependency(%q<rubytter>, [">= 0"])
202
- s.add_dependency(%q<bundler>, [">= 0"])
203
- s.add_dependency(%q<rcov>, [">= 0"])
204
- s.add_dependency(%q<rspec>, [">= 0"])
205
- s.add_dependency(%q<jeweler>, [">= 0"])
206
- end
207
- else
208
- s.add_dependency(%q<nokogiri>, [">= 0"])
209
- s.add_dependency(%q<oauth>, [">= 0"])
210
- s.add_dependency(%q<rubytter>, [">= 0"])
211
- s.add_dependency(%q<bundler>, [">= 0"])
212
- s.add_dependency(%q<rcov>, [">= 0"])
213
- s.add_dependency(%q<rspec>, [">= 0"])
214
- s.add_dependency(%q<jeweler>, [">= 0"])
215
- end
21
+ s.add_development_dependency "rspec"
22
+ s.add_development_dependency "guard"
23
+ s.add_development_dependency "guard-rspec"
24
+ s.add_development_dependency "ruby_gntp"
25
+ s.add_runtime_dependency "nokogiri"
26
+ s.add_runtime_dependency "eventmachine"
27
+ s.add_runtime_dependency "twitter"
28
+ s.add_runtime_dependency "httpclient"
216
29
  end
217
-
@@ -1,12 +1,16 @@
1
1
  module ConsadoleAggregator
2
2
  class Helper
3
- def self.concat text, opt=Hash.new('')
4
- base = "#{text} #{opt[:url]} #{opt[:hashtag]}".squeeze(' ').rstrip
3
+ PLACE_HOLDER = '@'
4
+ PLACE_HOLD_MATCHER = Regexp.compile("#{PLACE_HOLDER}{20}")
5
+
6
+ def self.truncate_for_twitter text, opt={}
7
+ url_place_holder = opt[:url] && PLACE_HOLDER*20 # twitter compress url to t.co as length 20 characters.
8
+ base = "#{text} #{url_place_holder} #{opt[:hashtag]}".squeeze(' ').rstrip
5
9
  if base.size > 140
6
10
  over_size = base.size - 140
7
- concat(omit(text, over_size), opt)
11
+ self.truncate_for_twitter(omit(text, over_size), opt)
8
12
  else
9
- base
13
+ base.gsub(PLACE_HOLD_MATCHER) { opt[:url] } # revert place holder to url
10
14
  end
11
15
  end
12
16