instapaper 0.3.0 → 1.0.0.pre2
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 +7 -0
- data/LICENSE.md +1 -1
- data/README.md +62 -38
- data/instapaper.gemspec +21 -30
- data/lib/instapaper.rb +0 -25
- data/lib/instapaper/api.rb +15 -0
- data/lib/instapaper/{client/account.rb → api/accounts.rb} +5 -5
- data/lib/instapaper/api/bookmarks.rb +77 -0
- data/lib/instapaper/{client/folder.rb → api/folders.rb} +12 -11
- data/lib/instapaper/api/highlights.rb +33 -0
- data/lib/instapaper/api/oauth.rb +17 -0
- data/lib/instapaper/bookmark.rb +21 -0
- data/lib/instapaper/bookmark_list.rb +20 -0
- data/lib/instapaper/client.rb +40 -28
- data/lib/instapaper/credentials.rb +12 -0
- data/lib/instapaper/error.rb +78 -0
- data/lib/instapaper/folder.rb +17 -0
- data/lib/instapaper/highlight.rb +16 -0
- data/lib/instapaper/http/headers.rb +45 -0
- data/lib/instapaper/http/qline_parser.rb +9 -0
- data/lib/instapaper/http/request.rb +84 -0
- data/lib/instapaper/http/utils.rb +67 -0
- data/lib/instapaper/user.rb +14 -0
- data/lib/instapaper/version.rb +1 -1
- metadata +63 -209
- data/.gemtest +0 -0
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -8
- data/.yardopts +0 -3
- data/Gemfile +0 -7
- data/Rakefile +0 -13
- data/lib/faraday/response/raise_http_1xxx.rb +0 -65
- data/lib/instapaper/authentication.rb +0 -32
- data/lib/instapaper/client/bookmark.rb +0 -81
- data/lib/instapaper/client/user.rb +0 -19
- data/lib/instapaper/configuration.rb +0 -88
- data/lib/instapaper/connection.rb +0 -35
- data/lib/instapaper/request.rb +0 -22
- data/spec/faraday/response_spec.rb +0 -22
- data/spec/fixtures/access_token.qline +0 -1
- data/spec/fixtures/bookmarks_add.json +0 -1
- data/spec/fixtures/bookmarks_archive.json +0 -1
- data/spec/fixtures/bookmarks_get_text.txt +0 -299
- data/spec/fixtures/bookmarks_list.json +0 -5
- data/spec/fixtures/bookmarks_move.json +0 -1
- data/spec/fixtures/bookmarks_star.json +0 -1
- data/spec/fixtures/bookmarks_unarchive.json +0 -1
- data/spec/fixtures/bookmarks_unstar.json +0 -1
- data/spec/fixtures/bookmarks_update_read_progress.json +0 -1
- data/spec/fixtures/folders_add.json +0 -1
- data/spec/fixtures/folders_delete.json +0 -1
- data/spec/fixtures/folders_list.json +0 -1
- data/spec/fixtures/folders_set_order.json +0 -1
- data/spec/fixtures/invalid_credentials.qline +0 -1
- data/spec/fixtures/verify_credentials.json +0 -1
- data/spec/instapaper/client/account_spec.rb +0 -27
- data/spec/instapaper/client/bookmark_spec.rb +0 -234
- data/spec/instapaper/client/folder_spec.rb +0 -89
- data/spec/instapaper/client/user_spec.rb +0 -36
- data/spec/instapaper/client_spec.rb +0 -65
- data/spec/instapaper_spec.rb +0 -85
- data/spec/spec_helper.rb +0 -52
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f6911bf834c466bf44a4ad781b290748a755afb0
|
4
|
+
data.tar.gz: 58b7928393bfbf9e2569b055d5d87f6438d68efb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3102c9408cf4579078b29516321f43681873632f93dd154ee8d4422b7f5e4609cf2c2272f8cc3e7fa6319304b1e5974dafbb2777f88bcb0571877548e5aa7ebf
|
7
|
+
data.tar.gz: b4b75bea5a250eae3ea9f3678714b029438a6db0cc5fc85e377e64b4fbaa4062bd767e3300412de2946cabba64e1be7e491a32443b0a80110db4b2e1b21eaac1
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
# Instapaper
|
1
|
+
# Instapaper [][travis] [][gemnasium]
|
2
2
|
|
3
|
-
|
3
|
+
[travis]: http://travis-ci.org/stve/instapaper
|
4
|
+
[gemnasium]: https://gemnasium.com/stve/instapaper
|
5
|
+
|
6
|
+
|
7
|
+
Instapaper is a ruby wrapper for interacting with [Instapaper's Full API](https://www.instapaper.com/api/full). Note that access to the Full API is restricted to Instapaper subscribers only.
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -8,16 +12,28 @@ Instapaper is a ruby wrapper for interacting with [Instapaper's Full Developer A
|
|
8
12
|
|
9
13
|
## Usage
|
10
14
|
|
11
|
-
|
15
|
+
This library offers full support for all methods exposed through Instapaper's Full API. Note that Instapaper's API does not support the request-token/authorize workflow. To obtain an access token, use the `access_token` method.
|
16
|
+
|
17
|
+
## Changes in 1.0.0
|
18
|
+
|
19
|
+
If you've used earlier versions of this library, a lot has changed in version `1.x`. While not a total rewrite, I've changed a number of things based on my experience writing API libraries:
|
20
|
+
|
21
|
+
* swapped out Faraday for http.rb
|
22
|
+
* responses now return custom classes instead of Hashie::Rash objects
|
23
|
+
* most API methods are more clear as to their behavior (i.e., `#star_bookmark` instead of just `#star`)
|
24
|
+
* module-based configuration and invocation has been removed, you'll now need to instantiate an `Instapaper::Client` instead (see usage below)
|
25
|
+
* Improved error handling
|
26
|
+
* Updates for version 1.1 of Instapaper's API
|
27
|
+
* Support for Highlights API
|
12
28
|
|
13
29
|
## Configuration
|
14
30
|
|
15
31
|
```ruby
|
16
|
-
Instapaper.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
32
|
+
client = Instapaper::Client.new do |client|
|
33
|
+
client.consumer_key = YOUR_CONSUMER_KEY
|
34
|
+
client.consumer_secret = YOUR_CONSUMER_SECRET
|
35
|
+
client.oauth_token = YOUR_OAUTH_TOKEN
|
36
|
+
client.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
|
21
37
|
end
|
22
38
|
```
|
23
39
|
|
@@ -26,13 +42,13 @@ end
|
|
26
42
|
To obtain an access token via xAuth:
|
27
43
|
|
28
44
|
```ruby
|
29
|
-
|
45
|
+
client.access_token(username, password)
|
30
46
|
```
|
31
47
|
|
32
48
|
You can also verify credentials once you have received tokens:
|
33
49
|
|
34
50
|
```ruby
|
35
|
-
|
51
|
+
client.verify_credentials
|
36
52
|
```
|
37
53
|
|
38
54
|
## Bookmark Operations
|
@@ -40,51 +56,56 @@ Instapaper.verify_credentials
|
|
40
56
|
Retrieve a list of bookmarks:
|
41
57
|
|
42
58
|
```ruby
|
43
|
-
|
59
|
+
client.bookmarks
|
44
60
|
```
|
45
61
|
|
46
62
|
Add a new bookmark:
|
47
63
|
|
48
64
|
```ruby
|
49
|
-
|
65
|
+
bookmark = {
|
66
|
+
title: 'This is the title',
|
67
|
+
description: 'This is the description',
|
68
|
+
}
|
69
|
+
|
70
|
+
client.add_bookmark('http://someurl.com', bookmark)
|
50
71
|
```
|
51
72
|
|
52
73
|
Remove a bookmark:
|
53
74
|
|
54
75
|
```ruby
|
55
|
-
|
76
|
+
client.delete_bookmark(bookmark_id)
|
56
77
|
```
|
57
78
|
|
58
79
|
Update read progress:
|
59
80
|
|
60
81
|
```ruby
|
61
|
-
|
82
|
+
client.update_read_progress(bookmark_id, 0.5)
|
62
83
|
```
|
63
84
|
|
64
85
|
Star/Un-star a bookmark:
|
65
86
|
|
66
87
|
```ruby
|
67
|
-
|
68
|
-
|
88
|
+
client.star_bookmark(bookmark_id)
|
89
|
+
client.unstar_bookmark(bookmark_id)
|
69
90
|
```
|
70
91
|
|
71
92
|
Archive/Un-archive a bookmark:
|
72
93
|
|
73
94
|
```ruby
|
74
|
-
|
75
|
-
|
95
|
+
client.archive_bookmark(bookmark_id)
|
96
|
+
client.unarchive_bookmark(bookmark_id)
|
76
97
|
```
|
77
98
|
|
78
99
|
Move a bookmark to a folder:
|
79
100
|
|
80
101
|
```ruby
|
81
|
-
|
102
|
+
client.move_bookmark(bookmark_id, folder_id)
|
82
103
|
```
|
83
104
|
|
84
105
|
Obtain the text of a bookmark:
|
85
106
|
|
86
107
|
```ruby
|
87
|
-
|
108
|
+
client.get_text(bookmark_id)
|
88
109
|
```
|
89
110
|
|
90
111
|
## Folder Operations
|
@@ -93,48 +114,51 @@ Instapaper.text(bookmark_id)
|
|
93
114
|
To obtain the list of folders:
|
94
115
|
|
95
116
|
```ruby
|
96
|
-
|
117
|
+
client.folders
|
97
118
|
```
|
98
119
|
|
99
120
|
You can add by passing a name:
|
100
121
|
|
101
122
|
```ruby
|
102
|
-
|
123
|
+
client.add_folder('eventmachine')
|
103
124
|
```
|
104
125
|
|
105
126
|
And remove folders by referencing a folder by it's id.
|
106
127
|
|
107
128
|
```ruby
|
108
|
-
|
129
|
+
client.delete_folder(folder_id)
|
109
130
|
```
|
110
131
|
|
111
132
|
Lastly, the folders can be reordered:
|
112
133
|
|
113
134
|
```ruby
|
114
|
-
|
135
|
+
client.set_order(['folder_id1:2','folder_id2:1'])
|
115
136
|
```
|
116
137
|
|
117
|
-
##
|
138
|
+
## Highlights Operations
|
118
139
|
|
119
|
-
|
140
|
+
Obtain highlights for a bookmark:
|
120
141
|
|
121
142
|
```ruby
|
122
|
-
|
123
|
-
Instapaper.verify_credentials
|
124
|
-
Instapaper.add_bookmark
|
125
|
-
Instapaper.folders
|
143
|
+
client.highlights(bookmark_id)
|
126
144
|
```
|
127
145
|
|
128
|
-
|
129
|
-
[][travis]
|
146
|
+
Add a highlight for a bookmark:
|
130
147
|
|
131
|
-
|
148
|
+
```ruby
|
149
|
+
highlight = {
|
150
|
+
text: 'And so we beat on, boats against the current, borne back ceaselessly into the past.',
|
151
|
+
position: 20,
|
152
|
+
}
|
132
153
|
|
133
|
-
|
134
|
-
|
154
|
+
client.add_highlight(bookmark_id, highlight)
|
155
|
+
```
|
135
156
|
|
136
|
-
|
157
|
+
Remove a highlight:
|
137
158
|
|
159
|
+
```ruby
|
160
|
+
client.delete_highlight(highlight_id)
|
161
|
+
```
|
138
162
|
|
139
163
|
## Documentation
|
140
164
|
|
@@ -146,10 +170,10 @@ Instapaper.folders
|
|
146
170
|
* Make your feature addition or bug fix.
|
147
171
|
* Add tests for it. This is important so I don't break it in a
|
148
172
|
future version unintentionally.
|
149
|
-
* Commit, do not mess with
|
173
|
+
* Commit, do not mess with Rakefile, gem version, or history.
|
150
174
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
151
175
|
* Send me a pull request. Bonus points for topic branches.
|
152
176
|
|
153
177
|
## Copyright
|
154
178
|
|
155
|
-
Copyright (c)
|
179
|
+
Copyright (c) 2015 Steve Agalloco. See [LICENSE](https://github.com/stve/instapaper/blob/master/LICENSE.md) for details.
|
data/instapaper.gemspec
CHANGED
@@ -1,32 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'instapaper/version'
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
gem.add_runtime_dependency('faraday_middleware', '~> 0.7')
|
24
|
-
gem.add_runtime_dependency('multi_json', '~> 1')
|
25
|
-
gem.add_runtime_dependency('rash', '~> 0.3')
|
26
|
-
gem.add_runtime_dependency('simple_oauth', '~> 0.1')
|
27
|
-
|
28
|
-
gem.files = `git ls-files`.split("\n")
|
29
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
30
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
31
|
-
gem.require_paths = ["lib"]
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.add_dependency 'addressable', '~> 2.3'
|
7
|
+
spec.add_dependency 'http', '~> 0.9'
|
8
|
+
spec.add_dependency 'multi_json', '~> 1'
|
9
|
+
spec.add_dependency 'simple_oauth', '~> 0.3'
|
10
|
+
spec.add_dependency 'virtus', '~> 1'
|
11
|
+
spec.add_development_dependency 'bundler', '~> 1.0'
|
12
|
+
spec.author = 'Steve Agalloco'
|
13
|
+
spec.description = "Ruby Client for Instapaper's Full API"
|
14
|
+
spec.email = 'steve.agalloco@gmail.com'
|
15
|
+
spec.files = %w(LICENSE.md README.md instapaper.gemspec) + Dir['lib/**/*.rb']
|
16
|
+
spec.homepage = 'https://github.com/stve/instapaper'
|
17
|
+
spec.licenses = %w(MIT)
|
18
|
+
spec.name = 'instapaper'
|
19
|
+
spec.require_paths = %w(lib)
|
20
|
+
spec.required_ruby_version = '>= 2.0.0'
|
21
|
+
spec.summary = 'Ruby Instapaper Client'
|
22
|
+
spec.version = Instapaper::VERSION
|
32
23
|
end
|
data/lib/instapaper.rb
CHANGED
@@ -1,26 +1 @@
|
|
1
|
-
require 'instapaper/configuration'
|
2
1
|
require 'instapaper/client'
|
3
|
-
|
4
|
-
module Instapaper
|
5
|
-
extend Configuration
|
6
|
-
|
7
|
-
# Alias for Instapaper::Client.new
|
8
|
-
#
|
9
|
-
# @return [Instapaper::Client]
|
10
|
-
def self.client(options={})
|
11
|
-
Instapaper::Client.new(options)
|
12
|
-
end
|
13
|
-
|
14
|
-
# Delegate to Instapaper::Client
|
15
|
-
def self.method_missing(method, *args, &block)
|
16
|
-
return super unless client.respond_to?(method)
|
17
|
-
client.send(method, *args, &block)
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.respond_to?(method, include_private = false)
|
21
|
-
client.respond_to?(method, include_private) || super(method, include_private)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Custom error class for rescuing from all Instapaper errors
|
25
|
-
class Error < StandardError; end
|
26
|
-
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'instapaper/api/accounts'
|
2
|
+
require 'instapaper/api/bookmarks'
|
3
|
+
require 'instapaper/api/folders'
|
4
|
+
require 'instapaper/api/highlights'
|
5
|
+
require 'instapaper/api/oauth'
|
6
|
+
|
7
|
+
module Instapaper
|
8
|
+
module API
|
9
|
+
include Instapaper::API::Accounts
|
10
|
+
include Instapaper::API::Bookmarks
|
11
|
+
include Instapaper::API::Folders
|
12
|
+
include Instapaper::API::Highlights
|
13
|
+
include Instapaper::API::OAuth
|
14
|
+
end
|
15
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
+
require 'instapaper/user'
|
2
|
+
|
1
3
|
module Instapaper
|
2
|
-
|
4
|
+
module API
|
3
5
|
# Defines methods related to accounts
|
4
|
-
module
|
5
|
-
|
6
|
+
module Accounts
|
6
7
|
# Returns the currently logged in user.
|
7
8
|
def verify_credentials
|
8
|
-
|
9
|
+
perform_post_with_object('/api/1.1/account/verify_credentials', {}, Instapaper::User)
|
9
10
|
end
|
10
|
-
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'instapaper/bookmark'
|
2
|
+
require 'instapaper/bookmark_list'
|
3
|
+
|
4
|
+
module Instapaper
|
5
|
+
module API
|
6
|
+
# Defines methods related to bookmarks
|
7
|
+
module Bookmarks
|
8
|
+
# Lists the user's unread bookmarks, and can also synchronize reading positions.
|
9
|
+
# @option limit: Optional. A number between 1 and 500, default 25.
|
10
|
+
# @option folder_id: Optional. Possible values are unread (default), starred, archive, or a folder_id value from /api/1.1/folders/list.
|
11
|
+
# @option have: Optional. A concatenation of bookmark_id values that the client already has from the specified folder. See below.
|
12
|
+
# @option highlights: Optional. A '-' delimited list of highlight IDs that the client already has from the specified bookmarks.
|
13
|
+
def bookmarks(options = {})
|
14
|
+
perform_post_with_object('/api/1.1/bookmarks/list', options, Instapaper::BookmarkList)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Updates the user's reading progress on a single article.
|
18
|
+
# @param bookmark_id [String] The id of the bookmark to update.
|
19
|
+
# @param progress [Float] The user's progress, as a floating-point number between 0.0 and 1.0, defined as the top edge of the user's current viewport, expressed as a percentage of the article's total length.
|
20
|
+
# @param progress_timestamp [Integer] The Unix timestamp value of the time that the progress was recorded.
|
21
|
+
def update_read_progress(bookmark_id, progress, progress_timestamp = Time.now)
|
22
|
+
perform_post_with_object('/api/1.1/bookmarks/update_read_progress', {bookmark_id: bookmark_id, progress: progress, progress_timestamp: progress_timestamp.to_i}, Instapaper::Bookmark)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Adds a new unread bookmark to the user's account.
|
26
|
+
# @param url [String] The url of the bookmark.
|
27
|
+
def add_bookmark(url, options = {})
|
28
|
+
perform_post_with_object('/api/1.1/bookmarks/add', options.merge(url: url), Instapaper::Bookmark)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Permanently deletes the specified bookmark.
|
32
|
+
# This is NOT the same as Archive. Please be clear to users if you're going to do this.
|
33
|
+
# @param bookmark_id [String] The id of the bookmark.
|
34
|
+
def delete_bookmark(bookmark_id)
|
35
|
+
perform_post_with_objects('/api/1.1/bookmarks/delete', {bookmark_id: bookmark_id}, Array)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Stars the specified bookmark.
|
39
|
+
# @param bookmark_id [String] The id of the bookmark.
|
40
|
+
def star_bookmark(bookmark_id)
|
41
|
+
perform_post_with_object('/api/1.1/bookmarks/star', {bookmark_id: bookmark_id}, Instapaper::Bookmark)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Un-stars the specified bookmark.
|
45
|
+
# @param bookmark_id [String] The id of the bookmark.
|
46
|
+
def unstar_bookmark(bookmark_id)
|
47
|
+
perform_post_with_object('/api/1.1/bookmarks/unstar', {bookmark_id: bookmark_id}, Instapaper::Bookmark)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Moves the specified bookmark to the Archive.
|
51
|
+
# @param bookmark_id [String] The id of the bookmark.
|
52
|
+
def archive_bookmark(bookmark_id)
|
53
|
+
perform_post_with_object('/api/1.1/bookmarks/archive', {bookmark_id: bookmark_id}, Instapaper::Bookmark)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Moves the specified bookmark to the top of the Unread folder.
|
57
|
+
# @param bookmark_id [String] The id of the bookmark.
|
58
|
+
def unarchive_bookmark(bookmark_id)
|
59
|
+
perform_post_with_object('/api/1.1/bookmarks/unarchive', {bookmark_id: bookmark_id}, Instapaper::Bookmark)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Moves the specified bookmark to a user-created folder.
|
63
|
+
# @param bookmark_id [String] The id of the bookmark.
|
64
|
+
# @param folder_id [String] The id of the folder to move the bookmark to.
|
65
|
+
def move_bookmark(bookmark_id, folder_id)
|
66
|
+
perform_post_with_object('/api/1.1/bookmarks/move', {bookmark_id: bookmark_id, folder_id: folder_id}, Instapaper::Bookmark)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns the specified bookmark's processed text-view HTML, which is
|
70
|
+
# always text/html encoded as UTF-8.
|
71
|
+
# @param bookmark_id [String] The id of the bookmark.
|
72
|
+
def get_text(bookmark_id)
|
73
|
+
perform_post_with_unparsed_response('/api/1.1/bookmarks/get_text', bookmark_id: bookmark_id)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -1,34 +1,35 @@
|
|
1
|
+
require 'instapaper/folder'
|
2
|
+
|
1
3
|
module Instapaper
|
2
|
-
|
4
|
+
module API
|
3
5
|
# Defines methods related to folders
|
4
|
-
module
|
5
|
-
|
6
|
-
# List the account’s user-created folders.
|
6
|
+
module Folders
|
7
|
+
# List the account's user-created folders.
|
7
8
|
# @note This only includes organizational folders and does not include RSS-feed folders or starred-subscription folders
|
8
9
|
def folders
|
9
|
-
|
10
|
+
perform_post_with_objects('/api/1.1/folders/list', {}, Instapaper::Folder)
|
10
11
|
end
|
11
12
|
|
12
13
|
# Creates an organizational folder.
|
13
14
|
# @param title [String] The title of the folder to create
|
14
15
|
def add_folder(title)
|
15
|
-
|
16
|
+
perform_post_with_object('/api/1.1/folders/add', {title: title}, Instapaper::Folder)
|
16
17
|
end
|
17
18
|
|
18
19
|
# Deletes the folder and moves any articles in it to the Archive.
|
19
20
|
# @param folder_id [String] The id of the folder.
|
20
21
|
def delete_folder(folder_id)
|
21
|
-
|
22
|
+
perform_post_with_unparsed_response('/api/1.1/folders/delete', folder_id: folder_id)
|
23
|
+
true
|
22
24
|
end
|
23
25
|
|
24
|
-
# Re-orders a user
|
26
|
+
# Re-orders a user's folders.
|
25
27
|
# @param order [Array] An array of folder_id:position pairs joined by commas.
|
26
28
|
# @example Ordering folder_ids 100, 200, and 300
|
27
29
|
# Instapaper.set_order(['100:1','200:2','300:3'])
|
28
|
-
def set_order(order=[])
|
29
|
-
|
30
|
+
def set_order(order = []) # rubocop:disable Style/AccessorMethodName
|
31
|
+
perform_post_with_objects('/api/1.1/folders/set_order', {order: order.join(',')}, Instapaper::Folder)
|
30
32
|
end
|
31
|
-
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|