pushbullet_client 0.0.1 → 0.0.2
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/README.md +8 -2
- data/lib/pushbullet/chats.rb +8 -0
- data/lib/pushbullet/client.rb +13 -43
- data/lib/pushbullet/devices.rb +8 -0
- data/lib/pushbullet/permanents.rb +14 -0
- data/lib/pushbullet/pushes.rb +8 -0
- data/lib/pushbullet/subscriptions.rb +8 -0
- data/lib/pushbullet/texts.rb +8 -0
- data/lib/pushbullet/users.rb +8 -0
- data/lib/pushbullet/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13463788a15fad6e416d2cf3fcbcf9a582f11f15d5066bae24b563794708b851
|
4
|
+
data.tar.gz: 83d8b80b52c871c097ca56abd3b14bffc9aca7195bed138980ac1f26e7dfdefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f01d2a23d2b3bef7f01219cd67555ad2595fb5a28f6d1bb333f56177aa3c08e4dad127b9cb6cc505545688bac278602a65db69777979e1b7730de499f6c4968e
|
7
|
+
data.tar.gz: 3a842fb075c008bf3b9c529387c8a3d74b2193e038d91a8c0e2ca93079fad10b3fdc9e5c5e614b4ce576e1631b97f6ad5777769498f758bfc782bd1aa9328a25
|
data/README.md
CHANGED
@@ -23,11 +23,17 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
```ruby
|
25
25
|
require 'pushbullet_client'
|
26
|
-
client = PushBullet::Client.new(
|
26
|
+
client = PushBullet::Client.new(access_token: 'your access_token')
|
27
27
|
```
|
28
28
|
|
29
29
|
### Endpoints
|
30
|
-
-
|
30
|
+
- Chats
|
31
|
+
- Devices
|
32
|
+
- Permanents
|
33
|
+
- Pushes
|
34
|
+
- Subscriptions
|
35
|
+
- Texts
|
36
|
+
- Users
|
31
37
|
|
32
38
|
### Constants
|
33
39
|
Constants
|
data/lib/pushbullet/client.rb
CHANGED
@@ -3,54 +3,24 @@ module Pushbullet
|
|
3
3
|
include ::Pushbullet::Constants
|
4
4
|
|
5
5
|
# Endpoints
|
6
|
-
|
7
|
-
|
6
|
+
include ::Pushbullet::Chats
|
7
|
+
include ::Pushbullet::Devices
|
8
|
+
include ::Pushbullet::Permanents
|
9
|
+
include ::Pushbullet::Pushes
|
10
|
+
include ::Pushbullet::Subscriptions
|
11
|
+
include ::Pushbullet::Texts
|
12
|
+
include ::Pushbullet::Users
|
13
|
+
|
14
|
+
# TODO: Add uploads
|
15
|
+
# TODO: Add ephemerals
|
16
|
+
# TODO: Websockets
|
17
|
+
# TODO: Universal copy/paste
|
18
|
+
# TODO: Encryption
|
8
19
|
# TODO: Pagination
|
9
20
|
# TODO: Limits
|
10
21
|
# TODO: Date parsing
|
11
22
|
# TODO: Create api client creation library
|
12
23
|
|
13
|
-
def me
|
14
|
-
path = 'users/me'
|
15
|
-
authorise_and_send(http_method: :get, path: path)
|
16
|
-
end
|
17
|
-
|
18
|
-
def devices
|
19
|
-
path = 'devices'
|
20
|
-
authorise_and_send(http_method: :get, path: path)
|
21
|
-
end
|
22
|
-
|
23
|
-
def pushes
|
24
|
-
path = 'pushes'
|
25
|
-
authorise_and_send(http_method: :get, path: path)
|
26
|
-
end
|
27
|
-
|
28
|
-
def chats
|
29
|
-
path = 'chats'
|
30
|
-
authorise_and_send(http_method: :get, path: path)
|
31
|
-
end
|
32
|
-
|
33
|
-
def subscriptions
|
34
|
-
path = 'subscriptions'
|
35
|
-
authorise_and_send(http_method: :get, path: path)
|
36
|
-
end
|
37
|
-
|
38
|
-
def texts
|
39
|
-
path = 'texts'
|
40
|
-
authorise_and_send(http_method: :get, path: path)
|
41
|
-
end
|
42
|
-
|
43
|
-
# See: https://stackoverflow.com/questions/38027963/pushbullet-api-thread-id-to-conversation-iden-for-sms
|
44
|
-
def permanents(device_identity:)
|
45
|
-
path = "permanents/#{device_identity}_threads"
|
46
|
-
authorise_and_send(http_method: :get, path: path)
|
47
|
-
end
|
48
|
-
|
49
|
-
def permanent_conversation(device_identity:, thread_id:)
|
50
|
-
path = "permanents/#{device_identity}_thread_#{thread_id}"
|
51
|
-
authorise_and_send(http_method: :get, path: path)
|
52
|
-
end
|
53
|
-
|
54
24
|
attr_reader :key, :secret, :base_path, :port
|
55
25
|
|
56
26
|
def initialize(access_token:, base_path: 'https://api.pushbullet.com/v2', port: 80)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Pushbullet
|
2
|
+
module Permanents
|
3
|
+
# See: https://stackoverflow.com/questions/38027963/pushbullet-api-thread-id-to-conversation-iden-for-sms
|
4
|
+
def permanents(device_identity:)
|
5
|
+
path = "permanents/#{device_identity}_threads"
|
6
|
+
authorise_and_send(http_method: :get, path: path)
|
7
|
+
end
|
8
|
+
|
9
|
+
def permanent_conversation(device_identity:, thread_id:)
|
10
|
+
path = "permanents/#{device_identity}_thread_#{thread_id}"
|
11
|
+
authorise_and_send(http_method: :get, path: path)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/pushbullet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushbullet_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- trex22
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|
@@ -196,8 +196,15 @@ files:
|
|
196
196
|
- bin/console
|
197
197
|
- bin/setup
|
198
198
|
- lib/pushbullet.rb
|
199
|
+
- lib/pushbullet/chats.rb
|
199
200
|
- lib/pushbullet/client.rb
|
200
201
|
- lib/pushbullet/constants.rb
|
202
|
+
- lib/pushbullet/devices.rb
|
203
|
+
- lib/pushbullet/permanents.rb
|
204
|
+
- lib/pushbullet/pushes.rb
|
205
|
+
- lib/pushbullet/subscriptions.rb
|
206
|
+
- lib/pushbullet/texts.rb
|
207
|
+
- lib/pushbullet/users.rb
|
201
208
|
- lib/pushbullet/version.rb
|
202
209
|
- pushbullet_client.gemspec
|
203
210
|
homepage: https://github.com/TRex22/pushbullet_client
|