ayadn 2.1 → 3.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.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +1 -2
- data/CHANGELOG.md +11 -0
- data/README.md +7 -9
- data/ayadn.gemspec +1 -2
- data/doc/02-install.md +11 -1
- data/doc/18-contact.md +0 -2
- data/lib/ayadn.rb +1 -1
- data/lib/ayadn/action.rb +13 -14
- data/lib/ayadn/annotations.rb +1 -1
- data/lib/ayadn/api.rb +8 -3
- data/lib/ayadn/app.rb +23 -11
- data/lib/ayadn/authorize.rb +47 -27
- data/lib/ayadn/cnx.rb +20 -3
- data/lib/ayadn/descriptions.rb +0 -12
- data/lib/ayadn/diagnostics.rb +471 -0
- data/lib/ayadn/endpoints.rb +47 -46
- data/lib/ayadn/extend.rb +20 -0
- data/lib/ayadn/fileops.rb +3 -3
- data/lib/ayadn/ids.rb +17 -0
- data/lib/ayadn/nicerank.rb +2 -0
- data/lib/ayadn/nowplaying.rb +12 -5
- data/lib/ayadn/post.rb +2 -0
- data/lib/ayadn/set.rb +78 -3
- data/lib/ayadn/settings.rb +20 -3
- data/lib/ayadn/status.rb +114 -62
- data/lib/ayadn/stream.rb +2 -0
- data/lib/ayadn/switch.rb +18 -11
- data/lib/ayadn/tvshow.rb +7 -3
- data/lib/ayadn/version.rb +1 -1
- data/lib/ayadn/view.rb +131 -82
- data/lib/ayadn/workers.rb +10 -11
- data/spec/mock/@ericd.json +4 -4
- data/spec/mock/ayadn.sqlite +0 -0
- data/spec/mock/files.json +2 -2
- data/spec/mock/fwr_@ayadn.json +4 -4
- data/spec/mock/int.json +13 -13
- data/spec/mock/mentions.json +4 -4
- data/spec/mock/nicerank.log +1 -1
- data/spec/mock/posted.json +1 -1
- data/spec/mock/regex.json +2 -2
- data/spec/unit/annotations_spec.rb +8 -8
- data/spec/unit/post_spec.rb +3 -3
- metadata +5 -20
- data/Guardfile +0 -26
- data/lib/ayadn/migration.rb +0 -431
data/lib/ayadn/tvshow.rb
CHANGED
@@ -3,6 +3,12 @@ module Ayadn
|
|
3
3
|
|
4
4
|
class TvShow
|
5
5
|
|
6
|
+
# Warning
|
7
|
+
# comment next line
|
8
|
+
require_relative "ids"
|
9
|
+
# uncomment and insert your own id
|
10
|
+
# TVDB_API_KEY = ""
|
11
|
+
|
6
12
|
begin
|
7
13
|
require 'tvdb_party'
|
8
14
|
rescue LoadError => e
|
@@ -11,14 +17,12 @@ module Ayadn
|
|
11
17
|
exit
|
12
18
|
end
|
13
19
|
|
14
|
-
AYADN_TVDB_API_KEY = 'E874ACBC542CAA53'
|
15
|
-
|
16
20
|
attr_accessor :language, :name, :poster_url, :banner_url, :plot, :text, :imdb_link, :tag, :link, :date
|
17
21
|
|
18
22
|
def initialize
|
19
23
|
@language = 'en'
|
20
24
|
@view = View.new
|
21
|
-
@tvdb = TvdbParty::Search.new(
|
25
|
+
@tvdb = TvdbParty::Search.new(TVDB_API_KEY)
|
22
26
|
@status = Status.new
|
23
27
|
end
|
24
28
|
|
data/lib/ayadn/version.rb
CHANGED
data/lib/ayadn/view.rb
CHANGED
@@ -4,7 +4,6 @@ module Ayadn
|
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@workers = Workers.new
|
7
|
-
@thor = Thor::Shell::Basic.new
|
8
7
|
@status = Status.new
|
9
8
|
end
|
10
9
|
|
@@ -45,7 +44,7 @@ module Ayadn
|
|
45
44
|
|
46
45
|
def show_posted(resp)
|
47
46
|
show_simple_post([resp['data']], {})
|
48
|
-
puts "\n" if
|
47
|
+
puts "\n" if timeline_is_compact
|
49
48
|
end
|
50
49
|
|
51
50
|
def show_list_reposted(list, target)
|
@@ -86,7 +85,7 @@ module Ayadn
|
|
86
85
|
puts "\t#{title}\n\n"
|
87
86
|
bucket.each.with_index(1) do |obj,index|
|
88
87
|
username = "@#{obj[1]}"
|
89
|
-
colored_username = username.color(
|
88
|
+
colored_username = username.color(color_username)
|
90
89
|
if obj[6].nil?
|
91
90
|
@workers.thor.say_status :warning, "user #{colored_username} has no posts, ignored", :red
|
92
91
|
newline()
|
@@ -98,9 +97,9 @@ module Ayadn
|
|
98
97
|
text = @workers.colorize_text(obj[6]["text"], mentions, hashtags)
|
99
98
|
total = "(#{obj[5]} posts)"
|
100
99
|
name = obj[2] == "" ? "(no name)" : obj[2]
|
101
|
-
colored_total = total.color(
|
102
|
-
colored_name = name.color(
|
103
|
-
colored_date = date.color(
|
100
|
+
colored_total = total.color(color_link)
|
101
|
+
colored_name = name.color(color_name)
|
102
|
+
colored_date = date.color(color_date)
|
104
103
|
puts "#{colored_username} #{colored_name} #{colored_date} #{colored_total}\n"
|
105
104
|
newline()
|
106
105
|
puts text
|
@@ -156,7 +155,7 @@ module Ayadn
|
|
156
155
|
opts = Settings.options.dup
|
157
156
|
opts.each do |k,v|
|
158
157
|
v.each do |x,y|
|
159
|
-
t << :separator if @iter >= 1 &&
|
158
|
+
t << :separator if @iter >= 1 && timeline_is_compact == false
|
160
159
|
unless y.is_a?(Hash)
|
161
160
|
t << [ k.to_s.color(:cyan), x.to_s.color(:yellow), y.to_s.color(:green) ]
|
162
161
|
else
|
@@ -181,7 +180,7 @@ module Ayadn
|
|
181
180
|
end
|
182
181
|
|
183
182
|
def show_userinfos(content, token, show_ranks = false)
|
184
|
-
if
|
183
|
+
if timeline_is_compact == true
|
185
184
|
padding = "\n"
|
186
185
|
view = "\n"
|
187
186
|
else
|
@@ -190,16 +189,16 @@ module Ayadn
|
|
190
189
|
end
|
191
190
|
|
192
191
|
if content['name']
|
193
|
-
view << "Name\t\t\t".color(:cyan) + content['name'].color(
|
192
|
+
view << "Name\t\t\t".color(:cyan) + content['name'].color(color_name)
|
194
193
|
else
|
195
194
|
view << "Name\t\t\t".color(:cyan) + "(no name)".color(:red)
|
196
195
|
end
|
197
196
|
|
198
|
-
view << "#{padding}Username\t\t".color(:cyan) + "@#{content['username']}".color(
|
197
|
+
view << "#{padding}Username\t\t".color(:cyan) + "@#{content['username']}".color(color_username)
|
199
198
|
|
200
|
-
view << "#{padding}ID\t\t\t".color(:cyan) + content['id'].color(
|
199
|
+
view << "#{padding}ID\t\t\t".color(:cyan) + content['id'].color(color_id)
|
201
200
|
|
202
|
-
view << "#{padding}URL\t\t\t".color(:cyan) + content['canonical_url'].color(
|
201
|
+
view << "#{padding}URL\t\t\t".color(:cyan) + content['canonical_url'].color(color_link)
|
203
202
|
|
204
203
|
unless content['verified_domain'].nil?
|
205
204
|
if content['verified_domain'] =~ (/http/ || /https/)
|
@@ -207,15 +206,15 @@ module Ayadn
|
|
207
206
|
else
|
208
207
|
domain = "http://#{content['verified_domain']}"
|
209
208
|
end
|
210
|
-
view << "\nVerified domain\t\t".color(:cyan) + domain.color(
|
209
|
+
view << "\nVerified domain\t\t".color(:cyan) + domain.color(color_link)
|
211
210
|
end
|
212
211
|
|
213
212
|
|
214
|
-
view << "#{padding}Account creation\t".color(:cyan) + @workers.parsed_time(content['created_at']).color(
|
215
|
-
view << "#{padding}TimeZone\t\t".color(:cyan) + content['timezone'].color(
|
216
|
-
view << "\nLocale\t\t\t".color(:cyan) + content['locale'].color(
|
213
|
+
view << "#{padding}Account creation\t".color(:cyan) + @workers.parsed_time(content['created_at']).color(color_excerpt)
|
214
|
+
view << "#{padding}TimeZone\t\t".color(:cyan) + content['timezone'].color(color_excerpt)
|
215
|
+
view << "\nLocale\t\t\t".color(:cyan) + content['locale'].color(color_excerpt)
|
217
216
|
|
218
|
-
view << "#{padding}Posts\t\t\t".color(:cyan) + content['counts']['posts'].to_s.color(
|
217
|
+
view << "#{padding}Posts\t\t\t".color(:cyan) + content['counts']['posts'].to_s.color(color_excerpt)
|
219
218
|
|
220
219
|
|
221
220
|
# unless show_ranks == false
|
@@ -223,46 +222,46 @@ module Ayadn
|
|
223
222
|
# # do call them all at once instead if many
|
224
223
|
# ranks = NiceRank.new.get_posts_day([content['id'].to_i])
|
225
224
|
# unless ranks.empty?
|
226
|
-
# view << "#{padding}Posts/day\t\t".color(:cyan) + ranks[0][:posts_day].to_s.color(
|
225
|
+
# view << "#{padding}Posts/day\t\t".color(:cyan) + ranks[0][:posts_day].to_s.color(color_excerpt)
|
227
226
|
# end
|
228
227
|
# end
|
229
228
|
|
230
|
-
view << "#{padding}Following\t\t".color(:cyan) + content['counts']['following'].to_s.color(
|
231
|
-
view << "\nFollowers\t\t".color(:cyan) + content['counts']['followers'].to_s.color(
|
229
|
+
view << "#{padding}Following\t\t".color(:cyan) + content['counts']['following'].to_s.color(color_excerpt)
|
230
|
+
view << "\nFollowers\t\t".color(:cyan) + content['counts']['followers'].to_s.color(color_excerpt)
|
232
231
|
|
233
232
|
if content['username'] == Settings.config[:identity][:username] && !token.nil?
|
234
|
-
view << "#{padding}Storage used\t\t".color(:cyan) + "#{token['storage']['used'].to_filesize}".color(
|
235
|
-
view << "\nStorage available\t".color(:cyan) + "#{token['storage']['available'].to_filesize}".color(
|
233
|
+
view << "#{padding}Storage used\t\t".color(:cyan) + "#{token['storage']['used'].to_filesize}".color(color_excerpt)
|
234
|
+
view << "\nStorage available\t".color(:cyan) + "#{token['storage']['available'].to_filesize}".color(color_excerpt)
|
236
235
|
end
|
237
236
|
|
238
237
|
#view << "\nStars\t\t\t".color(:cyan) + content['counts']['stars'].to_s.color(:yellow)
|
239
238
|
|
240
239
|
unless content['username'] == Settings.config[:identity][:username]
|
241
240
|
if content['you_follow']
|
242
|
-
view << "#{padding}You follow ".color(:cyan) + "@#{content['username']}".color(
|
241
|
+
view << "#{padding}You follow ".color(:cyan) + "@#{content['username']}".color(color_username)
|
243
242
|
else
|
244
|
-
view << "#{padding}You don't follow ".color(:cyan) + "@#{content['username']}".color(
|
243
|
+
view << "#{padding}You don't follow ".color(:cyan) + "@#{content['username']}".color(color_username)
|
245
244
|
end
|
246
245
|
if content['follows_you']
|
247
|
-
view << "\n" + "@#{content['username']}".color(
|
246
|
+
view << "\n" + "@#{content['username']}".color(color_username) + " follows you".color(:cyan)
|
248
247
|
else
|
249
|
-
view << "\n" + "@#{content['username']}".color(
|
248
|
+
view << "\n" + "@#{content['username']}".color(color_username) + " doesn't follow you".color(:cyan)
|
250
249
|
end
|
251
250
|
if content['you_muted']
|
252
|
-
view << "\nYou muted " + "@#{content['username']}".color(
|
251
|
+
view << "\nYou muted " + "@#{content['username']}".color(color_username)
|
253
252
|
end
|
254
253
|
if content['you_blocked']
|
255
|
-
view << "\nYou blocked " + "@#{content['username']}".color(
|
254
|
+
view << "\nYou blocked " + "@#{content['username']}".color(color_username)
|
256
255
|
end
|
257
256
|
end
|
258
257
|
|
259
258
|
unless content['annotations'].empty?
|
260
|
-
view << "\n" unless
|
259
|
+
view << "\n" unless timeline_is_compact == true
|
261
260
|
end
|
262
261
|
content['annotations'].each do |anno|
|
263
262
|
case anno['type']
|
264
263
|
when "net.app.core.directory.blog"
|
265
|
-
view << "\nBlog\t\t\t".color(:cyan) + "#{anno['value']['url']}".color(
|
264
|
+
view << "\nBlog\t\t\t".color(:cyan) + "#{anno['value']['url']}".color(color_link)
|
266
265
|
when "net.app.core.directory.twitter"
|
267
266
|
view << "\nTwitter\t\t\t".color(:cyan) + "#{anno['value']['username']}".color(:green)
|
268
267
|
when "com.appnetizens.userinput.birthday"
|
@@ -277,10 +276,10 @@ module Ayadn
|
|
277
276
|
mentions = content['description']['entities']['mentions'].map {|m| "@#{m['name']}"}
|
278
277
|
hashtags = content['description']['entities']['hashtags'].map {|m| m['name']}
|
279
278
|
view << "#{padding}#{@workers.colorize_text(content['description']['text'], mentions, hashtags)}\n"
|
280
|
-
view << "\n" unless
|
279
|
+
view << "\n" unless timeline_is_compact == true
|
281
280
|
end
|
282
281
|
|
283
|
-
view << "\n" if
|
282
|
+
view << "\n" if timeline_is_compact == true
|
284
283
|
|
285
284
|
puts view
|
286
285
|
|
@@ -319,55 +318,55 @@ module Ayadn
|
|
319
318
|
end
|
320
319
|
view << "\n"
|
321
320
|
view << "ID: ".color(:cyan)
|
322
|
-
view << "#{ch.id}".color(
|
321
|
+
view << "#{ch.id}".color(color_id)
|
323
322
|
view << "\n"
|
324
323
|
ch_alias = Databases.get_alias_from_id(ch.id)
|
325
324
|
unless ch_alias.nil?
|
326
325
|
view << "Alias: ".color(:cyan)
|
327
|
-
view << "#{ch_alias}".color(
|
326
|
+
view << "#{ch_alias}".color(color_username)
|
328
327
|
view << "\n"
|
329
328
|
end
|
330
329
|
view << "Messages: ".color(:cyan)
|
331
|
-
view << "#{ch.num_messages}".color(
|
330
|
+
view << "#{ch.num_messages}".color(color_symbols)
|
332
331
|
view << "\n"
|
333
332
|
if ch.owner
|
334
333
|
view << "Owner: ".color(:cyan)
|
335
|
-
view << "@#{ch.owner['username']}".color(
|
334
|
+
view << "@#{ch.owner['username']}".color(color_username)
|
336
335
|
# + (#{ch.owner['name']}) if ch.owner['name']
|
337
336
|
view << "\n"
|
338
337
|
end
|
339
338
|
unless options[:channels] # unless the request comes from Search
|
340
339
|
view << "Writers: ".color(:cyan)
|
341
|
-
view << "#{ch.writers}".color(
|
340
|
+
view << "#{ch.writers}".color(color_name)
|
342
341
|
view << "\n"
|
343
342
|
end
|
344
343
|
view << "Type: ".color(:cyan)
|
345
|
-
view << "#{ch.type}".color(
|
344
|
+
view << "#{ch.type}".color(color_index)
|
346
345
|
view << "\n"
|
347
346
|
if ch.type == "net.patter-app.room"
|
348
347
|
ann = ch.annotations.select {|a| a['type'] == "net.patter-app.settings"}
|
349
348
|
view << "Name: ".color(:cyan)
|
350
|
-
view << "#{ann[0]['value']['name']}".color(
|
349
|
+
view << "#{ann[0]['value']['name']}".color(color_link)
|
351
350
|
view << "\n"
|
352
351
|
view << "Description: ".color(:cyan)
|
353
|
-
view << "#{ann[0]['value']['blurb']}".color(
|
352
|
+
view << "#{ann[0]['value']['blurb']}".color(color_username)
|
354
353
|
view << "\n"
|
355
354
|
ann = ch.annotations.select {|a| a['type'] == "net.app.core.fallback_url"}
|
356
355
|
view << "URL: ".color(:cyan)
|
357
|
-
view << "#{ann[0]['value']['url']}".color(
|
356
|
+
view << "#{ann[0]['value']['url']}".color(color_link)
|
358
357
|
view << "\n"
|
359
358
|
end
|
360
359
|
if ch.type == "net.app.core.broadcast"
|
361
360
|
ann = ch.annotations.select {|a| a['type'] == "net.app.core.broadcast.metadata"}
|
362
361
|
view << "Title: ".color(:cyan)
|
363
|
-
view << "#{ann[0]['value']['title']}".color(
|
362
|
+
view << "#{ann[0]['value']['title']}".color(color_link)
|
364
363
|
view << "\n"
|
365
364
|
view << "Description: ".color(:cyan)
|
366
|
-
view << "#{ann[0]['value']['description']}".color(
|
365
|
+
view << "#{ann[0]['value']['description']}".color(color_username)
|
367
366
|
view << "\n"
|
368
367
|
ann = ch.annotations.select {|a| a['type'] == "net.app.core.fallback_url"}
|
369
368
|
view << "URL: ".color(:cyan)
|
370
|
-
view << "#{ann[0]['value']['url']}".color(
|
369
|
+
view << "#{ann[0]['value']['url']}".color(color_link)
|
371
370
|
view << "\n"
|
372
371
|
end
|
373
372
|
unless ch.recent_message.nil?
|
@@ -425,7 +424,7 @@ module Ayadn
|
|
425
424
|
end
|
426
425
|
|
427
426
|
def show_links(links)
|
428
|
-
links.each {|l| puts "#{l}".color(
|
427
|
+
links.each {|l| puts "#{l}".color(color_link)}
|
429
428
|
end
|
430
429
|
|
431
430
|
def all_hashtag_links(stream, hashtag)
|
@@ -491,7 +490,7 @@ module Ayadn
|
|
491
490
|
private
|
492
491
|
|
493
492
|
def newline
|
494
|
-
puts "\n" unless
|
493
|
+
puts "\n" unless timeline_is_compact == true
|
495
494
|
end
|
496
495
|
|
497
496
|
def get_broadcast_alias_from_id(event_id)
|
@@ -531,13 +530,13 @@ module Ayadn
|
|
531
530
|
arrow = arrow_count(options, content)
|
532
531
|
count = "#{arrow}#{format}"
|
533
532
|
if content[:username] == Settings.config[:identity][:username]
|
534
|
-
@view << count.color(
|
533
|
+
@view << count.color(color_index).inverse
|
535
534
|
elsif content[:mentions].include?(Settings.config[:identity][:username]) && options[:in_mentions].nil?
|
536
|
-
@view << count.color(
|
535
|
+
@view << count.color(color_mention).inverse
|
537
536
|
else
|
538
|
-
@view << count.color(
|
537
|
+
@view << count.color(color_index)
|
539
538
|
end
|
540
|
-
@view << ": ".color(
|
539
|
+
@view << ": ".color(color_index)
|
541
540
|
@view << build_content(content)
|
542
541
|
end
|
543
542
|
return posts, @view
|
@@ -549,11 +548,11 @@ module Ayadn
|
|
549
548
|
posts.each do |id,content|
|
550
549
|
content[:id] = arrow_id(options, content)
|
551
550
|
if content[:username] == Settings.config[:identity][:username]
|
552
|
-
@view << content[:id].color(
|
551
|
+
@view << content[:id].color(color_id).inverse + " "
|
553
552
|
elsif content[:mentions].include?(Settings.config[:identity][:username]) && options[:in_mentions].nil?
|
554
|
-
@view << content[:id].color(
|
553
|
+
@view << content[:id].color(color_mention).inverse + " "
|
555
554
|
else
|
556
|
-
@view << content[:id].color(
|
555
|
+
@view << content[:id].color(color_id) + " "
|
557
556
|
end
|
558
557
|
@view << build_content(content)
|
559
558
|
end
|
@@ -582,7 +581,7 @@ module Ayadn
|
|
582
581
|
inter = ""
|
583
582
|
data.reverse.each do |event|
|
584
583
|
users_array = []
|
585
|
-
inter << "#{@workers.parsed_time(event['event_date'])}".color(
|
584
|
+
inter << "#{@workers.parsed_time(event['event_date'])}".color(color_date)
|
586
585
|
inter << " => "
|
587
586
|
event['users'].each do |u|
|
588
587
|
users_array << "@" + u['username']
|
@@ -621,7 +620,7 @@ module Ayadn
|
|
621
620
|
inter << "welcomed ".color(:green)
|
622
621
|
inter << "you!".color(:yellow)
|
623
622
|
end
|
624
|
-
if
|
623
|
+
if timeline_is_compact == true
|
625
624
|
inter << "\n"
|
626
625
|
else
|
627
626
|
inter << "\n\n"
|
@@ -635,18 +634,18 @@ module Ayadn
|
|
635
634
|
view = "\n"
|
636
635
|
data.each do |file|
|
637
636
|
view << "ID\t\t".color(:cyan)
|
638
|
-
view << file['id'].color(
|
637
|
+
view << file['id'].color(color_id)
|
639
638
|
view << "\n"
|
640
639
|
view << "Name\t\t".color(:cyan)
|
641
|
-
view << file['name'].color(
|
640
|
+
view << file['name'].color(color_name)
|
642
641
|
view << "\n"
|
643
642
|
view << "Kind\t\t".color(:cyan)
|
644
|
-
view << file['kind'].color(
|
645
|
-
view << " (#{file['mime_type']})".color(
|
643
|
+
view << file['kind'].color(color_username)
|
644
|
+
view << " (#{file['mime_type']})".color(color_username) if file['mime_type']
|
646
645
|
if file['image_info']
|
647
646
|
view << "\n"
|
648
647
|
view << "Dimensions\t".color(:cyan)
|
649
|
-
view << "#{file['image_info']['width']} x #{file['image_info']['height']}".color(
|
648
|
+
view << "#{file['image_info']['width']} x #{file['image_info']['height']}".color(color_username)
|
650
649
|
end
|
651
650
|
view << "\n"
|
652
651
|
view << "Size\t\t".color(:cyan)
|
@@ -656,16 +655,16 @@ module Ayadn
|
|
656
655
|
view << @workers.parsed_time(file['created_at']).color(:green)
|
657
656
|
view << "\n"
|
658
657
|
view << "Source\t\t".color(:cyan)
|
659
|
-
view << file['source']['name'].color(
|
658
|
+
view << file['source']['name'].color(color_source)
|
660
659
|
view << "\n"
|
661
660
|
view << "State\t\t".color(:cyan)
|
662
661
|
if file['public']
|
663
|
-
view << "Public".color(
|
662
|
+
view << "Public".color(color_id)
|
664
663
|
view << "\n"
|
665
664
|
view << "Link\t\t".color(:cyan)
|
666
|
-
view << file['url_short'].color(
|
665
|
+
view << file['url_short'].color(color_link)
|
667
666
|
else
|
668
|
-
view << "Private".color(
|
667
|
+
view << "Private".color(color_id)
|
669
668
|
end
|
670
669
|
|
671
670
|
view << "\n\n"
|
@@ -676,21 +675,21 @@ module Ayadn
|
|
676
675
|
def build_content(content)
|
677
676
|
view = ""
|
678
677
|
view << build_header(content)
|
679
|
-
view << "\n" unless
|
678
|
+
view << "\n" unless timeline_is_compact == true
|
680
679
|
view << content[:text]
|
681
|
-
view << "\n" unless
|
680
|
+
view << "\n" unless timeline_is_compact == true
|
682
681
|
if content[:has_checkins]
|
683
682
|
view << build_checkins(content)
|
684
|
-
view << "\n" unless
|
683
|
+
view << "\n" unless timeline_is_compact == true
|
685
684
|
end
|
686
685
|
unless content[:links].empty?
|
687
686
|
view << "\n"
|
688
687
|
content[:links].each do |link|
|
689
|
-
view << link.color(
|
688
|
+
view << link.color(color_link)
|
690
689
|
view << "\n"
|
691
690
|
end
|
692
691
|
end
|
693
|
-
if
|
692
|
+
if timeline_is_compact == true
|
694
693
|
if content[:links].empty?
|
695
694
|
view << "\n"
|
696
695
|
else
|
@@ -703,32 +702,32 @@ module Ayadn
|
|
703
702
|
|
704
703
|
def build_header(content)
|
705
704
|
header = ""
|
706
|
-
header << content[:handle].color(
|
705
|
+
header << content[:handle].color(color_username)
|
707
706
|
if Settings.options[:timeline][:name]
|
708
707
|
header << " "
|
709
|
-
header << content[:name].color(
|
708
|
+
header << content[:name].color(color_name)
|
710
709
|
end
|
711
710
|
if Settings.options[:timeline][:date]
|
712
711
|
header << " "
|
713
712
|
if Settings.global[:scrolling] == false
|
714
|
-
header << content[:date].color(
|
713
|
+
header << content[:date].color(color_date)
|
715
714
|
else
|
716
715
|
if Settings.options[:scroll][:date] == false
|
717
|
-
header << content[:date_short].color(
|
716
|
+
header << content[:date_short].color(color_date)
|
718
717
|
else
|
719
|
-
header << content[:date].color(
|
718
|
+
header << content[:date].color(color_date)
|
720
719
|
end
|
721
720
|
end
|
722
721
|
end
|
723
722
|
if Settings.options[:timeline][:source]
|
724
723
|
header << " "
|
725
|
-
header << "[#{content[:source_name]}]".color(
|
724
|
+
header << "[#{content[:source_name]}]".color(color_source)
|
726
725
|
end
|
727
726
|
if Settings.options[:timeline][:symbols]
|
728
|
-
header << " <".color(
|
729
|
-
header << " #{content[:num_stars]}*".color(
|
730
|
-
header << " #{content[:num_reposts]}x".color(
|
731
|
-
header << " >".color(
|
727
|
+
header << " <".color(color_symbols) if content[:is_reply]
|
728
|
+
header << " #{content[:num_stars]}*".color(color_symbols) if content[:is_starred]
|
729
|
+
header << " #{content[:num_reposts]}x".color(color_symbols) if content[:num_reposts] > 0
|
730
|
+
header << " >".color(color_symbols) if content[:num_replies] > 0
|
732
731
|
end
|
733
732
|
header << "\n"
|
734
733
|
end
|
@@ -739,10 +738,10 @@ module Ayadn
|
|
739
738
|
else
|
740
739
|
num_dots = 10
|
741
740
|
end
|
742
|
-
if
|
741
|
+
if timeline_is_compact == true
|
743
742
|
hd = "\n"
|
744
743
|
else
|
745
|
-
hd = (".".color(
|
744
|
+
hd = (".".color(color_dots)) * num_dots
|
746
745
|
hd << "\n"
|
747
746
|
end
|
748
747
|
formatted = { header: hd }
|
@@ -753,7 +752,7 @@ module Ayadn
|
|
753
752
|
formatted[:name] = "" if formatted[:name].nil?
|
754
753
|
chk = formatted[:header]
|
755
754
|
unless formatted[:name] == ""
|
756
|
-
chk << formatted[:name].color(
|
755
|
+
chk << formatted[:name].color(color_dots)
|
757
756
|
chk << "\n"
|
758
757
|
end
|
759
758
|
unless formatted[:title].nil? || formatted[:title] == formatted[:name]
|
@@ -815,5 +814,55 @@ module Ayadn
|
|
815
814
|
chk.chomp
|
816
815
|
end
|
817
816
|
|
817
|
+
private
|
818
|
+
|
819
|
+
def color_username
|
820
|
+
Settings.options[:colors][:username]
|
821
|
+
end
|
822
|
+
|
823
|
+
def color_name
|
824
|
+
Settings.options[:colors][:name]
|
825
|
+
end
|
826
|
+
|
827
|
+
def color_link
|
828
|
+
Settings.options[:colors][:link]
|
829
|
+
end
|
830
|
+
|
831
|
+
def color_date
|
832
|
+
Settings.options[:colors][:date]
|
833
|
+
end
|
834
|
+
|
835
|
+
def color_id
|
836
|
+
Settings.options[:colors][:id]
|
837
|
+
end
|
838
|
+
|
839
|
+
def color_excerpt
|
840
|
+
Settings.options[:colors][:excerpt]
|
841
|
+
end
|
842
|
+
|
843
|
+
def color_symbols
|
844
|
+
Settings.options[:colors][:symbols]
|
845
|
+
end
|
846
|
+
|
847
|
+
def color_index
|
848
|
+
Settings.options[:colors][:index]
|
849
|
+
end
|
850
|
+
|
851
|
+
def color_mention
|
852
|
+
Settings.options[:colors][:mentions]
|
853
|
+
end
|
854
|
+
|
855
|
+
def color_source
|
856
|
+
Settings.options[:colors][:source]
|
857
|
+
end
|
858
|
+
|
859
|
+
def color_dots
|
860
|
+
Settings.options[:colors][:dots]
|
861
|
+
end
|
862
|
+
|
863
|
+
def timeline_is_compact
|
864
|
+
Settings.options[:timeline][:compact]
|
865
|
+
end
|
866
|
+
|
818
867
|
end
|
819
868
|
end
|