ayadn 0.6.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +20 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +17 -0
  5. data/Gemfile +14 -0
  6. data/Guardfile +26 -0
  7. data/LICENSE.txt +22 -0
  8. data/MANUAL.md +946 -0
  9. data/README.md +26 -411
  10. data/Rakefile +6 -0
  11. data/ayadn.gemspec +39 -0
  12. data/bin/ayadn +3 -3
  13. data/lib/ayadn.rb +12 -25
  14. data/lib/ayadn/action.rb +1121 -0
  15. data/lib/ayadn/alias.rb +106 -0
  16. data/lib/ayadn/api.rb +312 -301
  17. data/lib/ayadn/app.rb +429 -365
  18. data/lib/ayadn/authorize.rb +127 -28
  19. data/lib/ayadn/blacklist.rb +116 -0
  20. data/lib/ayadn/cnx.rb +105 -0
  21. data/lib/ayadn/databases.rb +110 -0
  22. data/lib/ayadn/descriptions.rb +1043 -0
  23. data/lib/ayadn/endpoints.rb +220 -153
  24. data/lib/ayadn/errors.rb +37 -0
  25. data/lib/ayadn/extend.rb +4 -10
  26. data/lib/ayadn/fileops.rb +48 -0
  27. data/lib/ayadn/logs.rb +32 -0
  28. data/lib/ayadn/pinboard.rb +46 -35
  29. data/lib/ayadn/post.rb +229 -212
  30. data/lib/ayadn/scroll.rb +251 -0
  31. data/lib/ayadn/set.rb +377 -0
  32. data/lib/ayadn/settings.rb +195 -0
  33. data/lib/ayadn/status.rb +226 -165
  34. data/lib/ayadn/switch.rb +72 -0
  35. data/lib/ayadn/version.rb +4 -0
  36. data/lib/ayadn/view.rb +506 -269
  37. data/lib/ayadn/workers.rb +362 -0
  38. data/spec/helpers.rb +19 -0
  39. data/spec/mock/@ericd.json +160 -0
  40. data/spec/mock/@m.json +45 -0
  41. data/spec/mock/checkins.json +1856 -0
  42. data/spec/mock/fwr_@ayadn.json +1077 -0
  43. data/spec/mock/posted.json +1 -0
  44. data/spec/mock/stream.json +1 -0
  45. data/spec/spec_helper.rb +14 -0
  46. data/spec/unit/api_spec.rb +61 -0
  47. data/spec/unit/databases_spec.rb +5 -0
  48. data/spec/unit/descriptions_spec.rb +9 -0
  49. data/spec/unit/endpoints_spec.rb +35 -0
  50. data/spec/unit/post_spec.rb +136 -0
  51. data/spec/unit/status_spec.rb +9 -0
  52. data/spec/unit/view_spec.rb +119 -0
  53. data/spec/unit/workers_spec.rb +147 -0
  54. metadata +216 -40
  55. data/CHANGELOG.md +0 -250
  56. data/CONTRIBUTORS.md +0 -5
  57. data/LICENSE.md +0 -14
  58. data/lib/ayadn/adn_files.rb +0 -84
  59. data/lib/ayadn/client-http.rb +0 -226
  60. data/lib/ayadn/colors.rb +0 -62
  61. data/lib/ayadn/config.yml +0 -35
  62. data/lib/ayadn/debug.rb +0 -36
  63. data/lib/ayadn/files.rb +0 -184
  64. data/lib/ayadn/get-api.rb +0 -43
  65. data/lib/ayadn/help.rb +0 -152
  66. data/lib/ayadn/list.rb +0 -89
  67. data/lib/ayadn/main.rb +0 -542
  68. data/lib/ayadn/requires.rb +0 -12
  69. data/lib/ayadn/skip.rb +0 -27
  70. data/lib/ayadn/tools.rb +0 -208
  71. data/lib/ayadn/user-stream.rb +0 -91
  72. data/lib/ayadn/view-channels.rb +0 -120
  73. data/lib/ayadn/view-interactions.rb +0 -57
  74. data/lib/ayadn/view-object.rb +0 -195
  75. data/lib/experiments.rb +0 -109
@@ -0,0 +1,195 @@
1
+ # encoding: utf-8
2
+ module Ayadn
3
+ class Settings
4
+
5
+ AYADN_CLIENT_ID = "hFsCGArAjgJkYBHTHbZnUvzTmL4vaLHL"
6
+
7
+ class << self
8
+ attr_accessor :options, :config
9
+ attr_reader :user_token
10
+ end
11
+
12
+ def self.load_config
13
+ db = Daybreak::DB.new(Dir.home + "/ayadn/accounts.db")
14
+ active = db['ACTIVE']
15
+ home = db[active][:path]
16
+ @config = {
17
+ paths: {
18
+ home: home,
19
+ log: "#{home}/log",
20
+ db: "#{home}/db",
21
+ pagination: "#{home}/pagination",
22
+ config: "#{home}/config",
23
+ auth: "#{home}/auth",
24
+ downloads: "#{home}/downloads",
25
+ backup: "#{home}/backup",
26
+ posts: "#{home}/backup/posts",
27
+ messages: "#{home}/backup/messages",
28
+ lists: "#{home}/backup/lists"
29
+ },
30
+ identity: {
31
+ id: db[active][:id],
32
+ username: db[active][:username],
33
+ handle: db[active][:handle]
34
+ }
35
+ }
36
+ db.close
37
+ @options = self.defaults
38
+ end
39
+
40
+ def self.get_token
41
+ if self.has_token_file?
42
+ @user_token = self.read_token_file
43
+ else
44
+ puts Status.not_authorized
45
+ exit
46
+ end
47
+ end
48
+
49
+ def self.init_config
50
+ @config[:version] = VERSION
51
+ @config[:platform] = RbConfig::CONFIG['host_os']
52
+ self.config_file
53
+ self.create_api_file
54
+ self.create_version_file
55
+ end
56
+
57
+ def self.save_config
58
+ File.write(@config[:paths][:config] + "/config.yml", @options.to_yaml)
59
+ end
60
+
61
+ def self.has_token_file?
62
+ File.exist?(@config[:paths][:auth] + "/token")
63
+ end
64
+
65
+ def self.read_token_file
66
+ File.read(@config[:paths][:auth] + "/token")
67
+ end
68
+
69
+ def self.config_file
70
+ config_file = @config[:paths][:config] + "/config.yml"
71
+ if File.exist?(config_file)
72
+ # TODO: system to merge existing config file when future category are added
73
+ begin
74
+ @options = YAML.load(File.read(config_file))
75
+ rescue => e
76
+ Errors.global_error("myconfig/load config.yml", nil, e)
77
+ end
78
+ else
79
+ begin
80
+ self.write_config_file(config_file, @options)
81
+ rescue => e
82
+ Errors.global_error("myconfig/create config.yml from defaults", nil, e)
83
+ end
84
+ end
85
+ end
86
+
87
+ def self.create_api_file
88
+ api_file = @config[:paths][:config] + "/api.json"
89
+ if File.exist?(api_file)
90
+ if ( File.ctime(api_file) < (Time.now - 172800) ) #48h in secs
91
+ self.new_api_file(api_file)
92
+ end
93
+ else
94
+ self.new_api_file(api_file)
95
+ end
96
+ self.read_api(api_file)
97
+ end
98
+
99
+ def self.create_version_file
100
+ File.write(@config[:paths][:config] + "/version.yml", {version: @config[:version]}.to_yaml)
101
+ end
102
+
103
+ def self.restore_defaults
104
+ self.load_config
105
+ File.write(@config[:paths][:config] + "/config.yml", @options.to_yaml)
106
+ end
107
+
108
+ private
109
+
110
+ def self.new_api_file(api_file)
111
+ api = API.new
112
+ resp = api.get_config
113
+ api.check_response_meta_code(resp)
114
+ File.write(api_file, resp['data'].to_json)
115
+ end
116
+
117
+ def self.read_api(api_file)
118
+ content = JSON.parse(File.read(api_file))
119
+ @config[:post_max_length] = content['post']['text_max_length']
120
+ @config[:message_max_length] = content['message']['text_max_length']
121
+ end
122
+
123
+ def self.has_version_file?
124
+ File.exist?(@config[:paths][:config] + "/version.yml")
125
+ end
126
+
127
+ def self.read_version_file
128
+ YAML.load(File.read(@config[:paths][:config] + "/version.yml"))
129
+ end
130
+
131
+ def self.write_config_file(config_file, options)
132
+ File.write(config_file, options.to_yaml)
133
+ end
134
+
135
+ def self.defaults
136
+ {
137
+ timeline: {
138
+ directed: 1,
139
+ deleted: 0,
140
+ html: 0,
141
+ annotations: 1,
142
+ show_source: true,
143
+ show_symbols: true,
144
+ show_real_name: true,
145
+ show_date: true
146
+ },
147
+ counts: {
148
+ default: 50,
149
+ unified: 50,
150
+ global: 50,
151
+ checkins: 50,
152
+ conversations: 50,
153
+ photos: 50,
154
+ trending: 50,
155
+ mentions: 50,
156
+ convo: 50,
157
+ posts: 50,
158
+ messages: 50,
159
+ search: 100,
160
+ whoreposted: 50,
161
+ whostarred: 50,
162
+ whatstarred: 100,
163
+ files: 66
164
+ },
165
+ formats: {
166
+ table: {
167
+ width: 75
168
+ }
169
+ },
170
+ colors: {
171
+ id: :blue,
172
+ index: :red,
173
+ username: :green,
174
+ name: :magenta,
175
+ date: :cyan,
176
+ link: :yellow,
177
+ dots: :blue,
178
+ hashtags: :cyan,
179
+ mentions: :red,
180
+ source: :cyan,
181
+ symbols: :green
182
+ },
183
+ backup: {
184
+ auto_save_sent_posts: false,
185
+ auto_save_sent_messages: false,
186
+ auto_save_lists: false
187
+ },
188
+ scroll: {
189
+ timer: 3
190
+ }
191
+ }
192
+ end
193
+
194
+ end
195
+ end
data/lib/ayadn/status.rb CHANGED
@@ -1,166 +1,227 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: utf-8
3
- class AyaDN
4
- class ClientStatus
5
- def canceled
6
- "\nCanceled.\n\n".red
7
- end
8
- def showList(list, name)
9
- if list == "muted"
10
- "Your list of muted users:\n".green
11
- elsif list == "followings"
12
- "List of users ".green + "#{name} ".brown + "is following:\n".green
13
- elsif list == "followers"
14
- "List of ".green + "#{name}".brown + "'s followers:\n".green
15
- end
16
- end
17
- def getInteractions
18
- "\nLoading the ".green + "interactions ".brown + "informations.\n".green
19
- end
20
- def launchAuthorization(os)
21
- if os == "osx"
22
- "\nAyaDN opened a browser to authorize via App.net very easily. Just login with your App.net account, then copy the code it will give you, paste it here then press [ENTER].".pink + " Paste authorization code: \n\n".brown
23
- else
24
- s = "\nPlease open a browser and paste this URL: \n\n".brown
25
- s += "https://account.app.net/oauth/authenticate?client_id=hFsCGArAjgJkYBHTHbZnUvzTmL4vaLHL&response_type=token&redirect_uri=http://aya.io/ayadn/auth.html&scope=basic stream write_post follow public_messages messages&include_marker=1"
26
- s += "\n\nOn this page, login with your App.net account, then copy the code it will give you, paste it here then press [ENTER].".pink + " Paste authorization code: \n\n".brown
27
- end
28
- end
29
- def authorized
30
- "\nThank you for authorizing AyaDN. You won't need to do this anymore.\n\n".green
31
- end
32
- def noNewPosts
33
- "\nNo new posts since your last visit.\n\n".red
34
- end
35
- def errorEmptyList
36
- "\nThe list is empty.\n\n".red
37
- end
38
- def errorSyntax
39
- "\nSyntax error.\n\n".red
40
- end
41
- def errorNotAuthorized
42
- "\nYou haven't authorized AyaDN yet.\n\n".red
43
- end
44
- def errorNobodyReposted
45
- "\nThis post hasn't been reposted by anyone.\n\n".red
46
- end
47
- def errorNobodyStarred
48
- "\nThis post hasn't been starred by anyone.\n\n".red
49
- end
50
- def errorNoID
51
- "\nError -> you must give a post ID to reply to.\n\n".red
52
- end
53
- def emptyPost
54
- "\nError -> there was no text to post.\n\n".red
55
- end
56
- def errorInfos(arg)
57
- "\nError -> ".red + "#{arg}".brown + " isn't a @username or a Post ID\n\n".red
58
- end
59
- def errorUserID(arg)
60
- "\nError -> ".red + "#{arg}".brown + " is not a @username\n\n".red
61
- end
62
- def errorPostID(arg)
63
- "\nError -> ".red + "#{arg}".brown + " is not a Post ID\n\n".red
64
- end
65
- def errorMessageNotSent
66
- "\n\nCanceled. Your message hasn't been sent.\n\n".red
67
- end
68
- def errorMessageTooLong(realLength, to_remove)
69
- "\nError: your message is ".red + "#{realLength} ".brown + "characters long, please remove ".red + "#{to_remove} ".brown + "characters.\n\n".red
70
- end
71
- def errorPostTooLong(realLength, to_remove)
72
- "\nError: your post is ".red + "#{realLength} ".brown + " characters long, please remove ".red + "#{to_remove} ".brown + "characters.\n\n".red
73
- end
74
- def errorPostNotSent
75
- "\n\nCanceled. Your post hasn't been sent.\n\n".red
76
- end
77
- def errorIsRepost(postID)
78
- "\n#{postID} ".brown + " is a repost.\n".red
79
- end
80
- def errorAlreadyDeleted
81
- "\nPost already deleted.\n\n".red
82
- end
83
- def redirectingToOriginal(postID)
84
- "Redirecting to the original post: ".cyan + "#{postID}\n".brown
85
- end
86
- def fetchingList(list)
87
- "\nFetching the \'#{list}\' list. Please wait\n".green
88
- end
89
- def getUnified
90
- "\nLoading the ".green + "unified ".brown + "Stream".green
91
- end
92
- def getExplore(explore)
93
- "\nLoading the ".green + "#{explore}".brown + " Stream".green
94
- end
95
- def getGlobal
96
- "\nLoading the ".green + "global ".brown + "Stream".green
97
- end
98
- def whoReposted(arg)
99
- s = "\nLoading informations on post ".green + "#{arg}".brown + "\n "
100
- s += "\nReposted by: \n".cyan
101
- end
102
- def whoStarred(arg)
103
- s = "\nLoading informations on post ".green + "#{arg}".brown + "\n"
104
- s += "\nStarred by: \n".cyan
105
- end
106
- def infosUser(arg)
107
- "\nLoading informations on ".green + "#{arg}".brown + "\n"
108
- end
109
- def infosPost(arg)
110
- "\nLoading informations on post ".green + "#{arg}".brown + "\n"
111
- end
112
- def postsUser(arg)
113
- "\nLoading posts of ".green + "#{arg}".brown + "\n"
114
- end
115
- def mentionsUser(arg)
116
- "\nLoading posts mentionning ".green + "#{arg}".brown + "\n"
117
- end
118
- def starsUser(arg)
119
- "\nLoading ".green + "#{arg}".reddish + "'s favorite posts\n".green
120
- end
121
- def starsPost(arg)
122
- "\nLoading users who starred post ".green + "#{arg}".reddish + "\n"
123
- end
124
- def getHashtags(arg)
125
- "\nLoading posts containing ".green + "##{arg}".pink + "\n".green
126
- end
127
- def sendPost
128
- "\nSending post\n".green
129
- end
130
- def sendMessage
131
- "\nSending private Message\n".green
132
- end
133
- def postSent
134
- "Successfully posted\n".green
135
- end
136
- def postDeleted
137
- "\nPost successfully deleted\n".green
138
- end
139
- def replyingToPost(postID)
140
- "\nReplying to post ".cyan + "#{postID}\n".brown
141
- end
142
- def deletePost(postID)
143
- "\nDeleting post ".green + "#{postID}".brown + "\n"
144
- end
145
- def getPostReplies(arg)
146
- "\nLoading the conversation around post ".green + "#{arg}".brown + "\n"
147
- end
148
- def writePost
149
- s = "\n#{$tools.ayadn_configuration[:post_max_length]} characters max, validate with [Enter] or cancel with [CTRL+C].\n".green
150
- s += "\nType your text: ".cyan
151
- end
152
- def writeMessage
153
- s = "\n#{$tools.ayadn_configuration[:message_max_length]} characters max, validate with [Enter] or cancel with [CTRL+C].\n".green
154
- s += "\nType your text: ".cyan + "\n\n"
155
- end
156
- def writeReply(arg)
157
- "\nLoading informations of post " + "#{arg}".brown + "\n"
158
- end
159
- def savingFile(name, path, file)
160
- "\nSaving ".green + "#{name} ".brown + "in ".green + "#{path}#{file}".magenta
161
- end
162
- def stopped
163
- "\n\nStopped.\n\n".red
164
- end
165
- end
166
- end
2
+ module Ayadn
3
+ class Status
4
+ def self.done
5
+ "\nDone.\n".color(:green)
6
+ end
7
+ def self.downloaded(name)
8
+ "\nFile downloaded in #{Settings.config[:paths][:downloads]}/#{name}\n".color(:green)
9
+ end
10
+ def self.downloading
11
+ "Downloading from ADN...\n".inverse
12
+ end
13
+ def self.posting
14
+ "Posting to ADN...\n".inverse
15
+ end
16
+ def self.deleting_post(post_id)
17
+ "\nDeleting post #{post_id}\n".inverse
18
+ end
19
+ def self.unfollowing(username)
20
+ "\nUnfollowing #{username}\n".inverse
21
+ end
22
+ def self.following(username)
23
+ "\nFollowing #{username}\n".inverse
24
+ end
25
+ def self.unmuting(username)
26
+ "\nUnmuting #{username}\n".inverse
27
+ end
28
+ def self.muting(username)
29
+ "\nMuting #{username}\n".inverse
30
+ end
31
+ def self.unblocking(username)
32
+ "\nUnblocking #{username}\n".inverse
33
+ end
34
+ def self.blocking(username)
35
+ "\nBlocking #{username}\n".inverse
36
+ end
37
+ def self.unreposting(post_id)
38
+ "\nUnreposting #{post_id}\n".inverse
39
+ end
40
+ def self.reposting(post_id)
41
+ "\nReposting #{post_id}\n".inverse
42
+ end
43
+ def self.unstarring(post_id)
44
+ "\nUnstarring #{post_id}\n".inverse
45
+ end
46
+ def self.starring(post_id)
47
+ "\nStarring #{post_id}\n".inverse
48
+ end
49
+ def self.not_deleted(post_id)
50
+ "Could not delete post #{post_id} (post isn't yours, or is already deleted)\n".color(:red)
51
+ end
52
+ def self.not_starred(post_id)
53
+ "Could not star post #{post_id} (post doesn't exist, or is already starred)\n".color(:red)
54
+ end
55
+ def self.not_unreposted(post_id)
56
+ "Could not unrepost post #{post_id} (post isn't yours, isn't a repost, or has been deleted)\n".color(:red)
57
+ end
58
+ def self.not_reposted(post_id)
59
+ "Could not repost post #{post_id} (post has been deleted?)\n".color(:red)
60
+ end
61
+ def self.not_unstarred(post_id)
62
+ "Could not unstar post #{post_id} (post isn't yours, isn't starred, or has been deleted)\n".color(:red)
63
+ end
64
+ def self.not_unfollowed(post_id)
65
+ "Could not unfollow user #{username} (doesn't exist, or wasn't already followed)\n".color(:red)
66
+ end
67
+ def self.not_followed(post_id)
68
+ "Could not follow user #{username} (doesn't exist, or you already follow)\n".color(:red)
69
+ end
70
+ def self.not_unmuted(post_id)
71
+ "Could not unmute user #{username} (doesn't exist, or wasn't already muted)\n".color(:red)
72
+ end
73
+ def self.not_muted(post_id)
74
+ "Could not mute user #{username} (doesn't exist, or is already muted)\n".color(:red)
75
+ end
76
+ def self.not_unblocked(post_id)
77
+ "Could not unblock user #{username} (doesn't exist, or wasn't already blocked)\n".color(:red)
78
+ end
79
+ def self.not_blocked(post_id)
80
+ "Could not block user #{username} (doesn't exist, or is already blocked)\n".color(:red)
81
+ end
82
+ def self.deleted(post_id)
83
+ "\nPost #{post_id} has been deleted.\n".color(:green)
84
+ end
85
+ def self.starred(post_id)
86
+ "\nPost #{post_id} has been starred.\n".color(:green)
87
+ end
88
+ def self.unreposted(post_id)
89
+ "\nPost #{post_id} has been unreposted.\n".color(:green)
90
+ end
91
+ def self.reposted(post_id)
92
+ "\nPost #{post_id} has been reposted.\n".color(:green)
93
+ end
94
+ def self.unstarred(post_id)
95
+ "\nPost #{post_id} has been unstarred.\n".color(:green)
96
+ end
97
+ def self.unfollowed(username)
98
+ "\nUser #{username} has been unfollowed.\n".color(:green)
99
+ end
100
+ def self.followed(username)
101
+ "\nUser #{username} has been followed.\n".color(:green)
102
+ end
103
+ def self.unmuted(username)
104
+ "\nUser #{username} has been unmuted.\n".color(:green)
105
+ end
106
+ def self.muted(username)
107
+ "\nUser #{username} has been muted.\n".color(:green)
108
+ end
109
+ def self.unblocked(username)
110
+ "\nUser #{username} has been unblocked.\n".color(:green)
111
+ end
112
+ def self.blocked(username)
113
+ "\nUser #{username} has been blocked.\n".color(:green)
114
+ end
115
+ def self.error_missing_username
116
+ "\nYou have to specify a username.\n".color(:red)
117
+ end
118
+ def self.error_missing_post_id
119
+ "\nYou have to specify a post id.\n".color(:red)
120
+ end
121
+ def self.error_missing_channel_id
122
+ "\nYou have to specify a channel id.\n".color(:red)
123
+ end
124
+ def self.error_missing_hashtag
125
+ "\nYou have to specify one or more hashtag(s).\n".color(:red)
126
+ end
127
+ def self.error_missing_parameters
128
+ "\nYou have to submit valid items. See 'ayadn -sg' for a list of valid parameters and values.\n".color(:red)
129
+ end
130
+ def self.empty_list
131
+ "\n\nThe list is empty.\n\n".color(:red)
132
+ end
133
+ def self.not_found
134
+ "\n\n404 NOT FOUND - Object does not exist or has been deleted\n\n"
135
+ end
136
+ def self.stopped
137
+ "\n\nStopped.".color(:red)
138
+ end
139
+ def self.yourpost
140
+ "\nYour post:\n\n".color(:cyan)
141
+ end
142
+ def self.replying_to(post_id)
143
+ "\nReplying to post #{post_id}...\n".color(:green)
144
+ end
145
+ def self.readline
146
+ "\nType your text. ".color(:cyan) + "[CTRL+D] ".color(:green) + "to validate, ".color(:cyan) + "[CTRL+C] ".color(:red) + "to cancel.\n\n".color(:cyan)
147
+ end
148
+ def self.classic
149
+ "\nType your text. ".color(:cyan) + "[ENTER] ".color(:green) + "to validate, ".color(:cyan) + "[CTRL+C] ".color(:red) + "to cancel.\n\n".color(:cyan)
150
+ end
151
+ def self.reply
152
+ "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum. If the original post has mentions, you text will be inserted after the first one. Markdown links are supported.\n\n"
153
+ end
154
+ def self.post
155
+ "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum. Markdown links are supported.\n\n"
156
+ end
157
+ def self.message
158
+ "\n#{Settings.config[:message_max_length]} ".color(:yellow) + "characters maximum. Markdown links are supported.\n\n"
159
+ end
160
+ # def self.method_missing(meth, args)
161
+ # "\nThe command '#{meth} #{args}' doesn't exist.\n".color(:red)
162
+ # end
163
+ def self.valid_colors(colors_list)
164
+ "\nThe valid colors are: #{colors_list}\n".color(:cyan)
165
+ end
166
+ def self.not_mutable
167
+ "\nThis parameter is not modifiable for the time being, sorry.\n".color(:red)
168
+ end
169
+ def self.must_be_integer
170
+ "\nThis paramater must be an integer between 1 and 200.\n".color(:red)
171
+ end
172
+ def self.no_new_posts
173
+ "\nNo new posts since your last visit.\n\n".color(:cyan)
174
+ end
175
+ def self.type_and_target_missing
176
+ "\nYou have to submit a TYPE (mention, hashtag, client name) and a TARGET (a @username, a hashtag, a client name)\n\n".color(:red)
177
+ end
178
+ def self.wrong_arguments
179
+ "\nYou have to submit valid arguments.\n\n".color(:red)
180
+ end
181
+ def self.no_pin_creds
182
+ "\nAyadn couldn't find your Pinboard credentials.\n".color(:red)
183
+ end
184
+ def self.pin_creds_saved
185
+ "\n\nCredentials successfully encoded and saved in database.\n\n".color(:green)
186
+ end
187
+ def self.saving_pin
188
+ "\nSaving post text and links to Pinboard...\n\n".color(:yellow)
189
+ end
190
+ def self.error_only_osx
191
+ "\nThis feature only works with Mac OS X and iTunes, sorry.\n\n".color(:red)
192
+ end
193
+ def self.empty_fields
194
+ "\nCanceled: couldn't get enough information (empty field).\n\n".color(:red)
195
+ end
196
+ def self.canceled
197
+ "\n\nCanceled.\n\n".color(:cyan)
198
+ end
199
+ def self.not_authorized
200
+ "\nYou need to authorize Ayadn before using it.\n\nPlease run 'ayadn authorize' :)\n\n".color(:red)
201
+ end
202
+ def self.wtf
203
+ "\nSomething wrong happened. :(\n\n".color(:red)
204
+ end
205
+ def self.redirecting
206
+ "\nPost is a repost. Redirecting...\n\n".color(:cyan)
207
+ end
208
+ def self.nobody_reposted
209
+ "\nNobody reposted this post.\n\n".color(:red)
210
+ end
211
+ def self.nobody_starred
212
+ "\nNobody starred this post.\n\n".color(:red)
213
+ end
214
+ def self.not_your_repost
215
+ "\nThis post isn't one of your reposts.\n\n".color(:red)
216
+ end
217
+ def self.not_your_starred
218
+ "\nThis isn't one of your starred posts.\n\n".color(:red)
219
+ end
220
+ def self.auto
221
+ view = "\nEntering the auto posting mode.\n\n".color(:cyan)
222
+ view << "In this mode, each line you type (each time you hit ENTER!) is automatically posted to ADN.\n\n".color(:cyan)
223
+ view << "At any moment, starting now, hit CTRL+C to exit.\n\n".color(:yellow)
224
+ view << "\n\t--AUTO POSTING MODE ACTIVATED--\n\n".color(:red)
225
+ end
226
+ end
227
+ end