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
data/README.md CHANGED
@@ -1,440 +1,55 @@
1
+ [![Build Status](https://travis-ci.org/ericdke/na.svg?branch=master)](https://travis-ci.org/ericdke/na)
2
+
1
3
  AYADN
2
4
  =====
3
5
 
4
- [App.net](http://app.net) command-line client developed in Ruby.
5
-
6
- [![Gem Version](https://badge.fury.io/rb/ayadn.png)](http://badge.fury.io/rb/ayadn)
7
-
8
- - [FEATURES](#features)
9
- - [TL;DR](#tldr)
10
- - [IMPORTANT NOTE](#important-note)
11
- - [INSTALL](#install)
12
- - [HOW TO USE](#how-to-use)
13
- - [LIST OF COMMANDS](#list-of-commands)
14
- - [TIPS](#tips)
15
- - [Skip specific posts](#skip-specific-posts)
16
- - [Backup some data](#backup-some-data)
17
- - [Post links](#post-links)
18
- - [Reset pagination data](#reset-pagination-data)
19
- - [Custom posts count](#custom-posts-count)
20
- - [Pinboard](#pinboard)
21
- - ["me"](#me)
22
- - [Shortcuts](#shortcuts)
23
- - [Channels](#channels)
24
- - [Just for fun](#just-for-fun)
25
- - [HELP](#help)
26
- - [Console](#console)
27
- - [Database](#database)
28
- - [CONTACT](#contact)
29
- - [CREDITS](#credits)
30
- - [Beta-testers](#beta-testers)
31
-
32
- ## FEATURES
33
-
34
- - read/scroll your App.net stream
35
-
36
- - write a post
37
-
38
- - reply to a post
39
-
40
- - read the conversation around a post
41
-
42
- - star/unstar a post
43
-
44
- - repost/unrepost a post
45
-
46
- - quote a post
47
-
48
- - send a private message
49
-
50
- - read your private messages
51
-
52
- - follow/unfollow a user
53
-
54
- - ask if a user follows another one
55
-
56
- - mute/unmute a user
57
-
58
- - search posts for word(s)
59
-
60
- - search posts with hashtag
61
-
62
- - get informations on a post/user
63
-
64
- - read/scroll posts from a user
65
-
66
- - read/scroll posts mentioning a user
67
-
68
- - read posts starred by a user
69
-
70
- - see users who starred/reposted a post
71
-
72
- - read/scroll other streams: "checkins", "global", "trending", "conversations"
73
-
74
- - read a timeline of your interactions
75
-
76
- - delete a post/message
77
-
78
- - save/load a post locally
6
+ [App.net](http://app.net) command-line client.
79
7
 
80
- - backup/display your lists of followings, followers, muted users...
8
+ The purpose of Ayadn is to give you access to all the features of App.net from the command line.
81
9
 
82
- - create links with Markdown in your text
10
+ 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.
83
11
 
84
- - skip posts from specific client (like IFTTT, PourOver, etc)
12
+ More than 50 features await for your Geekiness to command them.
85
13
 
86
- - skip posts containing specific #hashtag
14
+ Ayadn is configurable: colors, timelines, durations, aliases, etc.
87
15
 
88
- - skip posts containing specific @username
16
+ 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.
89
17
 
90
- - list, download, delete files from your ADN account
18
+ 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.
91
19
 
92
- - change file attribute: public/private
20
+ Last but not least: Ayadn supports multi-accounting! Authorize as many accounts as you wish and simply switch between them with a keystroke.
93
21
 
94
- - upload files to your ADN account *(only OS X and Linux)*
95
-
96
- - list your subscribed channels
97
-
98
- - post to your subscribed channels
99
-
100
- - save a post link to your Pinboard account
101
-
102
- - post the current iTunes song with #nowplaying hashtag *(only OS X)*
103
-
104
- - [and more!](https://github.com/ericdke/ayadn#list-of-commands)
105
-
106
- *There's also a [landing page](http://ayadn-app.net) and, of course, the [blog](http://ayadn.re-app.net).*
107
-
108
- ## TL;DR
109
-
110
- ```
111
- gem install ayadn
112
- ayadn authorize
113
- ayadn write 'Posting to App.net with Ruby!'
114
- ```
115
-
116
- ## IMPORTANT NOTE
117
-
118
- Ayadn is currently in a transition process from beta to v1.
119
-
120
- The current [na](https://github.com/ericdke/na) repository will become Ayadn v1 when ready and complete (multi account, automatic initial configuration, configuration with ayadn commands, modular code, OSS rules compliant, new layout, new features, new options, etc).
121
22
 
122
23
  ## INSTALL
123
24
 
124
- In your console/terminal:
125
-
126
- ```
127
- gem install ayadn
128
- ```
129
-
130
- ## HOW TO USE
131
-
132
- You have to authorize Ayadn to use your App.net credentials.
133
-
134
- *Just run Ayadn to start the process!*
135
-
136
- **`ayadn` + optional action + optional target(s) + optional value(s)**
137
-
138
- If you don't provide any option to Ayadn, your personnalized stream is displayed.
139
-
140
- By default, Ayadn displays only the new posts in the stream since your last visit.
141
-
142
- **I strongly recommend you run this command after install:**
143
-
144
- `ayadn install config`
145
-
146
- **so that you can then customize the `~/ayadn/data/config.yml` file this command will create.**
147
-
148
- *Note: Ayadn will try and use your existing authorization if you had a previous version installed. If it fails, just run `ayadn authorize` again.*
149
-
150
- ## LIST OF COMMANDS
151
-
152
- *Only the first lines include the `[PRESS ENTER KEY]` reminder for obvious readability reasons.*
153
-
154
- ```
155
- ayadn [PRESS ENTER KEY]
156
- ayadn scroll [PRESS ENTER KEY]
157
- ayadn write [PRESS ENTER KEY]
158
- ayadn write '@ericd Good morning Eric!' [PRESS ENTER KEY]
159
- ayadn reply 18527205 [PRESS ENTER KEY]
160
- ayadn pm @ericd [PRESS ENTER KEY]
161
- ayadn global
162
- ayadn scroll global
163
- ayadn checkins
164
- ayadn scroll checkins
165
- ayadn trending
166
- ayadn scroll trending
167
- ayadn photos
168
- ayadn scroll photos
169
- ayadn conversations
170
- ayadn scroll conversations
171
- ayadn mentions @ericd
172
- ayadn scroll mentions @ericd
173
- ayadn posts @ericd
174
- ayadn scroll posts @ericd
175
- ayadn starred @ericd
176
- ayadn starred 18527205
177
- ayadn reposted 18527205
178
- ayadn infos @ericd
179
- ayadn infos 18527205
180
- ayadn convo 15726105
181
- ayadn tag nowplaying
182
- ayadn follow @ericd
183
- ayadn unfollow @ericd
184
- ayadn mute @ayaio
185
- ayadn unmute @ayaio
186
- ayadn block @spammer
187
- ayadn unblock @spammer
188
- ayadn nowplaying
189
- ayadn interactions
190
- ayadn list files
191
- ayadn list files all
192
- ayadn download 286458
193
- ayadn download 286458,286797
194
- ayadn upload /path/to/kitten.jpg
195
- ayadn private 286458
196
- ayadn public 286458
197
- ayadn delete-file 286458
198
- ayadn search ruby
199
- ayadn search ruby,json
200
- ayadn channels
201
- ayadn send 12345
202
- ayadn messages 12345
203
- ayadn messages 12345 all
204
- ayadn star 18527205
205
- ayadn unstar 18527205
206
- ayadn repost 18527205
207
- ayadn unrepost 18527205
208
- ayadn quote 18527205
209
- ayadn delete 12345678
210
- ayadn delete-message 12345 23456789
211
- ayadn list muted
212
- ayadn list followings @ericd
213
- ayadn list followers @ericd
214
- ayadn backup muted
215
- ayadn backup followings @ericd
216
- ayadn backup followers @ericd
217
- ayadn save 18527205
218
- ayadn load 18527205
219
- ayadn skip-source add IFTTT
220
- ayadn skip-source remove IFTTT
221
- ayadn skip-source show
222
- ayadn skip-tag add sports
223
- ayadn skip-tag remove sports
224
- ayadn skip-tag show
225
- ayadn skip-mention add username
226
- ayadn skip-mention remove username
227
- ayadn skip-mention show
228
- ayadn pin 16864003 ruby,json
229
- ayadn alias-channel 12345 channel_name
230
- ayadn messages channel_name
231
- ayadn list alias
232
- ayadn unified 10
233
- ayadn global 10
234
- ayadn checkins 10
235
- ayadn photos 10
236
- ayadn trending 10
237
- ayadn conversations 10
238
- ayadn mentions @ericd 10
239
- ayadn posts @ericd 10
240
- ayadn starred @ericd 10
241
- ayadn does @ericd follow @ayadn
242
- ayadn reset pagination
243
- ayadn list options
244
- ayadn help
245
- ayadn commands
246
- ayadn webhelp
247
- ayadn random
248
- ```
249
-
250
- ## HELP
251
-
252
- ### Writing in the console/terminal
253
-
254
- Be aware of the way the console/terminal treats what you type if you're using ayadn inline, like this: `ayadn write "Hello"`
255
-
256
- When posting with `"double quotes"`, any special character will be interpreted by the command line!
257
-
258
- So you have to post with `'simple quotes'` instead, this way the console don't mess with your content.
259
-
260
- But it creates other problems...
261
-
262
- **My advice: post with the compose feature, that is to say without providing your text inline:**
263
-
264
- `ayadn write`
265
-
266
- Then just write your text, nothing else is needed, no single or double quotes.
267
-
268
- ### Database
269
-
270
- Ayadn keeps a database of the ids of all the users it sees (it reduces the number of API calls and speeds up the app.)
271
-
272
- If you think that this file is causing problems to Ayadn or if it's simply getting too big, just trash it.
273
-
274
- The file is: `%USERNAME%/ayadn/data/username/db/users.db`
275
-
276
- ## TIPS
277
-
278
- ### Skip specific posts
279
-
280
- You can make posts containing a specific *hashtag*, like "#sports", or from a specific *client*, like "IFTTT" disappear from your timeline.
281
-
282
- It works with users too: although App.net has the *mute* feature, it doesn't prevent the muted user to appear in reposts or to see posts mentioning him/her. This command allows you to do it.
283
-
284
- *ayadn skip-xxx add/remove target* to add/remove from the 'skipped' list.
285
-
286
- - Skip posts from specific client:
287
-
288
- `ayadn skip-source add IFTTT`
289
-
290
- - Skip posts with specific hashtag:
291
-
292
- `ayadn skip-tag add sports`
293
-
294
- - Skip posts with mentioning specific user:
295
-
296
- `ayadn skip-mention add username`
297
-
298
- Change of mind?
299
-
300
- `ayadn skip-source remove IFTTT`
301
- `ayadn skip-tag remove sports`
302
- `ayadn skip-mention remove username`
303
-
304
- There's basically no verification with this feature, so be careful to not add misspelled or non-existent info.
305
-
306
- ### Backup some data
307
-
308
- ```
309
- ayadn backup followings @ericd
310
- ayadn backup followers @ericd
311
- ayadn backup muted
312
- ```
313
-
314
- A JSON file containing the username and real name of your followings/followers/muted will be saved in `%USERDIR%/ayadn/data/lists`.
315
-
316
- The `muted` option only works for yourself (this is a normal limitation from the API).
317
-
318
- ### Post links
319
-
320
- - Write/paste a simple link:
321
-
322
- ```
323
- ayadn write 'Subscribe to the #Ayadn broadcast! https://app.net/c/2zqf'
324
- ```
325
-
326
- - Write/paste a markdown link to embed the link:
327
-
328
- ```
329
- ayadn write '[Subscribe](https://app.net/c/2zqf) to the #Ayadn broadcast!'
330
- ```
331
-
332
- ### Reset pagination data
333
-
334
- If Ayadn shows you "No recent posts" but you still want to see the stream again, you have to reset the pagination data first.
335
-
336
- ```
337
- ayadn reset
338
- ayadn reset pagination unified
339
- ayadn reset pagination mentions @ericd
340
- ayadn reset pagination posts @ericd
341
- (etc)
342
- ```
343
-
344
- Without arguments: resets all your pagination data.
345
-
346
- *Note: Ayadn doesn't use Stream Markers (stream syncing), and it's not a bug but a feature :p This is because Ayadn is meant as an independent tool that shouldn't interfere with other ADN clients.*
347
-
348
- ### Custom posts count
349
-
350
- You can specify the number of posts retrieved with most streams:
351
-
352
- ```
353
- ayadn unified 10
354
- ayadn global 10
355
- ayadn checkins 10
356
- ayadn photos 10
357
- ayadn trending 10
358
- ayadn conversations 10
359
- ayadn mentions @ericd 10
360
- ayadn posts @ericd 10
361
- ayadn starred @ericd 10
362
- ```
363
-
364
- ### Pinboard
365
-
366
- Export a post link + text + tags to Pinboard:
367
-
368
- `ayadn pin 15723266 tag1,tag2`
369
-
370
- ### "me"
371
-
372
- With some features you can replace `@username` by `me` if you want to check yourself:
373
-
374
- ```
375
- ayadn mentions me
376
- ayadn scroll mentions me
377
- ayadn posts me
378
- ayadn starred me
379
- ayadn infos me
380
- ayadn list followings me
381
- (etc)
382
- ```
383
-
384
- ### Shortcuts
385
-
386
- Some commands have shortcuts:
387
-
388
- - write: w
389
- - reply: r
390
- - quote: q
391
- - mentions: m
392
- - posts: p
393
- - channels: ch
394
- - messages: msg
395
- - infos: i
396
- - convo: c
397
- - tag: t
398
- - search: s
399
- - nowplaying: np
400
- - help: h
401
-
402
- Examples:
403
-
404
- ```
405
- ayadn w
406
- ayadn r 12345678
407
- ayadn m @ericd
408
- ayadn t ruby
409
- ayadn np
410
- ```
25
+ Install:
411
26
 
412
- *Other commands don't have a shortcut, reducing the risk of accidental manipulation.*
27
+ `gem install ayadn`
413
28
 
414
- ### Channels
29
+ Update:
415
30
 
416
- You may display your channels with `ayadn channels` and read their messages with `ayadn messages 12345` with 12345 being the channel ID.
31
+ `gem update ayadn`
417
32
 
418
- To ease the process, you can create aliases for channel IDs:
33
+ ### OS X, LINUX, BSD
419
34
 
420
- `ayadn alias-channel 12345 mychannel`
35
+ Please use something like RVM or RBENV to install Ruby if necessary.
421
36
 
422
- then read its messages with `ayadn messages mychannel`.
37
+ You can also use the Ruby shipped with your system but you shouldn't, as it would require root privileges.
423
38
 
424
- List your existing aliases with `ayadn list alias`.
39
+ ### WINDOWS
425
40
 
426
- Aliases are cumulable. If something goes wrong, just trash the file: `%USERNAME%/ayadn/data/username/db/channels_alias.db`
41
+ You have to run one more command:
427
42
 
428
- ### Just for fun
43
+ `gem install win32console -v 1.3.2`
429
44
 
430
- `ayadn random`
45
+ # DOCUMENTATION
431
46
 
432
- ## CONTACT
47
+ Read the [manual](https://github.com/ericdke/na/blob/master/MANUAL.md).
433
48
 
434
- Contact me on ADN [(@ericd)](http://alpha.app.net/ericd) if you have questions, ideas, or... if you know Ruby and you want to help a newbie to code better. ;)
49
+ # CONTACT
435
50
 
436
- The app's account is [@ayadn](http://alpha.app.net/ayadn) and will be used for support, bug report, etc.
51
+ Author: [@ericd](http://app.net/ericd)
437
52
 
438
- There's also a [Broadcast channel](https://app.net/c/2zqf) for important announcements.
53
+ App account: [@ayadn](http://app.net/ayadn)
439
54
 
440
- Don't bother with @ayaio or @aya_tests, they're bots.
55
+ Website: [ayadn-app.net](http://ayadn-app.net)