ayadn 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f500f323caa3910e67daf9a38647f61c0a8b571a
4
- data.tar.gz: 11f5b44c9a6fcda4d13bf56f5f99b0ff21985bb0
3
+ metadata.gz: 178f8d0b90c3d05a395d913d20b5ceeb8e9e4889
4
+ data.tar.gz: f8905a19ce739307c6dd510a8776e2ea58c1e11e
5
5
  SHA512:
6
- metadata.gz: 38d76af0d377cabdc0ec2caece47b1c625c0013dea9a91345fa66e8f50b9fdaa8406dd0bc09565af9c47e52c10b8d865c962e2e16138a9f3288fd590ef0f2ed9
7
- data.tar.gz: a7c83646b121f2b642827fe144ce8fc77e844484ff1cd906f6f3af04f22ffbd3aebd74a29e075c5ca56fa56285d7e9b4656d0154c008306ecc0566878a506505
6
+ metadata.gz: 7dc47ef7305ce368c37200bac11320620ed2fdd25733bba82df29e6449e750420de501b7f2d43239267d324ea4c551d90024db2d616f997bf30d7a221e97b9bd
7
+ data.tar.gz: 491d12154549d299528217d8561edfbf4eb6e2d44b8bac4baac906b9480d0dde2413ec8821844590bc8eb1a2ef7f349464a24d53a854a5bf238d5b5e4d015eee
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 1.0.13
2
+
3
+ - New layout for '#nowplaying'
4
+ - Compact index.db and pagination.db if necessary
5
+ - New api urls
6
+ - Fix 'download file'
7
+
1
8
  # 1.0.12
2
9
 
3
10
  - Fixed an error in: authorizing an account if its folders already exists
data/README.md CHANGED
@@ -6,19 +6,19 @@ AYADN
6
6
 
7
7
  [App.net](http://app.net) command-line client.
8
8
 
9
- The purpose of Ayadn is to give you access to all the features of App.net from the command line.
9
+ The purpose of Ayadn is to give you access to all the features of App.net from the console.
10
10
 
11
- View or scroll all streams, view or scroll conversations and posts from specific users or mentioning a user, follow/unfollow users, star/unstar/repost/etc, get information about users and their followers/followings, search for words or hashtags, list and download your files, view all your channels including Broadcasts and Patter rooms, write single-line or multi-line posts, send private messages, view geolocation data, etc.
11
+ View or scroll all streams in your Terminal, view or scroll conversations and posts from specific users or mentioning a user, follow/unfollow users, star/unstar/repost/etc, get information about users and their followers/followings, search for words or hashtags, list and download your files, view all your channels including Broadcasts and Patter rooms, write single-line or multi-line posts, send private messages, view geolocation data, etc.
12
12
 
13
- More than 50 features await for your Geekiness to command them.
13
+ This CLI has more than 50 features awaiting for your Geekiness to command them.
14
14
 
15
15
  Ayadn is configurable: colors, timelines, durations, aliases, etc.
16
16
 
17
- You can also specify many options from the commande line, like show the raw JSON instead of the formatted response, show only a number of most recents posts, show only new posts, etc.
17
+ You can also specify many options, like show the raw JSON instead of the formatted response, show only a number of most recents posts, show only new posts, etc.
18
18
 
19
19
  There's also exclusive features, like the Blacklist: feed this mini database with usernames, client names or hashtags and Ayadn will never show you any post containing any of these elements.
20
20
 
21
- Last but not least: Ayadn supports multi-accounting! Authorize as many accounts as you wish and simply switch between them with a keystroke.
21
+ Last but not least: Ayadn supports multiple ADN accounts! Authorize as many accounts as you wish and simply switch between them with a keystroke.
22
22
 
23
23
 
24
24
  ## INSTALL
data/lib/ayadn/action.rb CHANGED
@@ -800,7 +800,8 @@ module Ayadn
800
800
  abort(Status.empty_fields) if el.length == 0
801
801
  end
802
802
  @view.clear_screen
803
- text_to_post = "#nowplaying '#{itunes.track}' from '#{itunes.album}' by #{itunes.artist}"
803
+ #text_to_post = "#nowplaying '#{itunes.track}' from '#{itunes.album}' by #{itunes.artist}"
804
+ text_to_post = "#nowplaying\nTitle: ‘#{itunes.track}’\nArtist: #{itunes.artist}\nfrom ‘#{itunes.album}’"
804
805
  show_nowplaying(text_to_post)
805
806
  unless STDIN.getch == ("y" || "Y")
806
807
  puts "\nCanceled.\n\n".color(:red)
@@ -1133,7 +1134,7 @@ module Ayadn
1133
1134
  end
1134
1135
 
1135
1136
  def show_nowplaying(text)
1136
- puts "\nThis is what will be posted:\n".color(:cyan)
1137
+ puts "\nYour post:\n".color(:cyan)
1137
1138
  puts text + "\n\n"
1138
1139
  puts "Do you confirm? (y/N) ".color(:yellow)
1139
1140
  end
@@ -74,7 +74,7 @@ module Ayadn
74
74
  end
75
75
 
76
76
  def get_user(token)
77
- JSON.parse(RestClient.get("https://alpha-api.app.net/stream/0/users/me?access_token=#{token}", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) {|response, request, result| response })
77
+ JSON.parse(RestClient.get("https://api.app.net/users/me?access_token=#{token}", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) {|response, request, result| response })
78
78
  end
79
79
 
80
80
  def get_token
data/lib/ayadn/cnx.rb CHANGED
@@ -19,7 +19,7 @@ module Ayadn
19
19
  end
20
20
 
21
21
  def self.check(response)
22
- message = JSON.parse(response)['meta']['error_message']
22
+ message = JSON.parse(response)['meta']['error_message'] if response.code != 200
23
23
  case response.code
24
24
  when 200
25
25
  response
@@ -16,6 +16,8 @@ module Ayadn
16
16
  end
17
17
 
18
18
  def self.close_all
19
+ @pagination.compact if (File.size("#{Settings.config[:paths][:pagination]}/pagination.db") > (250000))
20
+ @index.compact if (File.size("#{Settings.config[:paths][:pagination]}/index.db") > (250000))
19
21
  [@users, @index, @pagination, @aliases, @blacklist].each do |db|
20
22
  db.flush
21
23
  db.close
@@ -6,13 +6,13 @@ module Ayadn
6
6
 
7
7
  def initialize
8
8
  @ayadn_callback_url = "http://aya.io/ayadn/auth.html"
9
- @base_url = "https://alpha-api.app.net/"
10
- @config_api_url = @base_url + "stream/0/config"
11
- @posts_url = @base_url + "stream/0/posts/"
12
- @users_url = @base_url + "stream/0/users/"
13
- @files_url = @base_url + "stream/0/files/"
14
- @token_url = @base_url + "stream/0/token/"
15
- @channels_url = @base_url + "stream/0/channels/"
9
+ @base_url = "https://api.app.net/"
10
+ @config_api_url = @base_url + "config"
11
+ @posts_url = @base_url + "posts/"
12
+ @users_url = @base_url + "users/"
13
+ @files_url = @base_url + "files/"
14
+ @token_url = @base_url + "token/"
15
+ @channels_url = @base_url + "channels/"
16
16
  @pm_url = @channels_url + "pm/messages"
17
17
  end
18
18
 
data/lib/ayadn/errors.rb CHANGED
@@ -2,16 +2,16 @@
2
2
  module Ayadn
3
3
  class Errors
4
4
  def self.global_error(where, args, error)
5
- elems = []
6
- args.each {|arg| elems << self.detokenize(arg)}
5
+ #elems = []
6
+ #args.each {|arg| elems << self.detokenize(arg)} #TODO: make it work
7
7
  Logs.rec.error "--BEGIN--"
8
8
  Logs.rec.error "#{error}"
9
9
  Logs.rec.debug "LOCATION: #{where}"
10
- Logs.rec.debug "DATA: #{elems}" unless elems.nil?
10
+ Logs.rec.debug "DATA: #{args}"
11
11
  Logs.rec.debug "STACK: #{caller}"
12
12
  Logs.rec.error "--END--"
13
13
  puts "\n(error logged in #{Settings.config[:paths][:log]}/ayadn.log)\n".color(:blue)
14
- #raise error
14
+ raise error
15
15
  exit
16
16
  end
17
17
  def self.error(status)
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "1.0.12"
3
+ VERSION = "1.0.13"
4
4
  end
@@ -18,18 +18,18 @@ describe Ayadn::Endpoints do
18
18
  end
19
19
  describe '#token_info' do
20
20
  it "returns the Token url" do
21
- expect(Ayadn::Endpoints.new.token_info).to eq 'https://alpha-api.app.net/stream/0/token/?access_token=XXX'
21
+ expect(Ayadn::Endpoints.new.token_info).to eq 'https://api.app.net/token/?access_token=XXX'
22
22
  end
23
23
  end
24
24
  describe '#unified' do
25
25
  it "returns the Unified url" do
26
- expect(Ayadn::Endpoints.new.unified({})).to eq 'https://alpha-api.app.net/stream/0/posts/stream/unified?access_token=XXX&count=33&include_html=0&include_directed=1&include_deleted=0&include_annotations=1'
26
+ expect(Ayadn::Endpoints.new.unified({})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=33&include_html=0&include_directed=1&include_deleted=0&include_annotations=1'
27
27
  end
28
28
  it "returns the Unified url" do
29
- expect(Ayadn::Endpoints.new.unified({count: 66, html: 1})).to eq 'https://alpha-api.app.net/stream/0/posts/stream/unified?access_token=XXX&count=66&include_html=1&include_directed=1&include_deleted=0&include_annotations=1'
29
+ expect(Ayadn::Endpoints.new.unified({count: 66, html: 1})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=66&include_html=1&include_directed=1&include_deleted=0&include_annotations=1'
30
30
  end
31
31
  it "returns the Unified url" do
32
- expect(Ayadn::Endpoints.new.unified({since_id: 336699})).to eq 'https://alpha-api.app.net/stream/0/posts/stream/unified?access_token=XXX&count=100&include_html=0&include_directed=1&include_deleted=0&include_annotations=1&since_id=336699'
32
+ expect(Ayadn::Endpoints.new.unified({since_id: 336699})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=100&include_html=0&include_directed=1&include_deleted=0&include_annotations=1&since_id=336699'
33
33
  end
34
34
  end
35
35
  end
@@ -58,7 +58,7 @@ describe Ayadn::Post do
58
58
  expect(printed).to include "You should provide some text."
59
59
  end
60
60
  it "posts a post" do
61
- expect(rest).to receive(:post).with("https://alpha-api.app.net/stream/0/posts/?include_annotations=1&access_token=XYZ", {"text"=>"YOLO", "entities"=>{"parse_markdown_links"=>true, "parse_links"=>true}, "annotations"=>[{"type"=>"com.ayadn.user", "value"=>{"+net.app.core.user"=>{"user_id"=>"@test", "format"=>"basic"}}}, {"type"=>"com.ayadn.client", "value"=>{"url"=>"http://ayadn-app.net", "author"=>{"name"=>"Eric Dejonckheere", "username"=>"ericd", "id"=>"69904", "email"=>"eric@aya.io"}, "version"=>"wee"}}]})
61
+ expect(rest).to receive(:post).with("https://api.app.net/posts/?include_annotations=1&access_token=XYZ", {"text"=>"YOLO", "entities"=>{"parse_markdown_links"=>true, "parse_links"=>true}, "annotations"=>[{"type"=>"com.ayadn.user", "value"=>{"+net.app.core.user"=>{"user_id"=>"@test", "format"=>"basic"}}}, {"type"=>"com.ayadn.client", "value"=>{"url"=>"http://ayadn-app.net", "author"=>{"name"=>"Eric Dejonckheere", "username"=>"ericd", "id"=>"69904", "email"=>"eric@aya.io"}, "version"=>"wee"}}]})
62
62
  x = post.post(['YOLO'])
63
63
  end
64
64
  it "returns the posted post" do
metadata CHANGED
@@ -1,181 +1,181 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ayadn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.18'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.18'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: terminal-table
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: daybreak
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pinboard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.5'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.5'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '10.1'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '10.1'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '2.14'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '2.14'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rb-fsevent
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - '>='
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0.9'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.9'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: guard-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - '>='
158
158
  - !ruby/object:Gem::Version
159
159
  version: '4.2'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - '>='
165
165
  - !ruby/object:Gem::Version
166
166
  version: '4.2'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: coveralls
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: 'App.net command-line client: toolbox to access and manage your ADN data,
@@ -187,10 +187,10 @@ executables:
187
187
  extensions: []
188
188
  extra_rdoc_files: []
189
189
  files:
190
- - ".coveralls.yml"
191
- - ".gitignore"
192
- - ".rspec"
193
- - ".travis.yml"
190
+ - .coveralls.yml
191
+ - .gitignore
192
+ - .rspec
193
+ - .travis.yml
194
194
  - CHANGELOG.md
195
195
  - Gemfile
196
196
  - Guardfile
@@ -259,17 +259,17 @@ require_paths:
259
259
  - lib
260
260
  required_ruby_version: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - ">="
262
+ - - '>='
263
263
  - !ruby/object:Gem::Version
264
264
  version: 1.9.3
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - ">="
267
+ - - '>='
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  requirements: []
271
271
  rubyforge_project:
272
- rubygems_version: 2.2.2
272
+ rubygems_version: 2.0.3
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: App.net command-line client.