pushbullet_client 0.0.25 → 0.0.26
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/.github/dependabot.yml +12 -0
- data/.gitignore +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +29 -22
- data/bin/console +3 -0
- data/lib/pushbullet/client.rb +4 -2
- data/lib/pushbullet/version.rb +1 -1
- data/pushbullet_client.gemspec +4 -2
- data/test_pushes.rb +33 -0
- metadata +36 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c8b1613f7979f7bbe0ec7362e7b8bb995713f62e7a774ab931be8621cebbbe1
|
|
4
|
+
data.tar.gz: 305d62c78204c1c37c78d635d83fa8cc118cfa3bf1261a3dc6ef05b5dc900316
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0e28bd2efbf3074ee2d9586731e2bd8b6c227080c31eb3daa93279583ad8bdc3d71ded14e223ddde35edba870c7e10584c1578ba7fc1ee690b09c4886378fe0
|
|
7
|
+
data.tar.gz: 4522b27715c94a2f07bf02196ef40da4e641479a5ce32f145bd1c1a27221e05f7b2f78c895d11eedd45c7796a803649cf77c4303a3da6307ba190857404b1fd3
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.9
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pushbullet_client (0.0.
|
|
5
|
-
httparty (~> 0.24.
|
|
6
|
-
nokogiri (~> 1.19.
|
|
4
|
+
pushbullet_client (0.0.26)
|
|
5
|
+
httparty (~> 0.24.3)
|
|
6
|
+
nokogiri (~> 1.19.7)
|
|
7
|
+
oj (~> 3.17.8)
|
|
7
8
|
|
|
8
9
|
GEM
|
|
9
10
|
remote: https://rubygems.org/
|
|
@@ -21,9 +22,10 @@ GEM
|
|
|
21
22
|
bigdecimal
|
|
22
23
|
rexml
|
|
23
24
|
csv (3.3.5)
|
|
25
|
+
dotenv (2.8.1)
|
|
24
26
|
drb (2.2.3)
|
|
25
27
|
hashdiff (1.2.1)
|
|
26
|
-
httparty (0.24.
|
|
28
|
+
httparty (0.24.3)
|
|
27
29
|
csv
|
|
28
30
|
mini_mime (>= 1.0.0)
|
|
29
31
|
multi_xml (>= 0.5.2)
|
|
@@ -44,22 +46,24 @@ GEM
|
|
|
44
46
|
ruby2_keywords (>= 0.0.5)
|
|
45
47
|
multi_xml (0.8.1)
|
|
46
48
|
bigdecimal (>= 3.1, < 5)
|
|
47
|
-
nokogiri (1.19.
|
|
49
|
+
nokogiri (1.19.7-aarch64-linux-gnu)
|
|
48
50
|
racc (~> 1.4)
|
|
49
|
-
nokogiri (1.19.
|
|
51
|
+
nokogiri (1.19.7-aarch64-linux-musl)
|
|
50
52
|
racc (~> 1.4)
|
|
51
|
-
nokogiri (1.19.
|
|
53
|
+
nokogiri (1.19.7-arm-linux-gnu)
|
|
52
54
|
racc (~> 1.4)
|
|
53
|
-
nokogiri (1.19.
|
|
55
|
+
nokogiri (1.19.7-arm-linux-musl)
|
|
54
56
|
racc (~> 1.4)
|
|
55
|
-
nokogiri (1.19.
|
|
57
|
+
nokogiri (1.19.7-arm64-darwin)
|
|
56
58
|
racc (~> 1.4)
|
|
57
|
-
nokogiri (1.19.
|
|
59
|
+
nokogiri (1.19.7-x86_64-darwin)
|
|
58
60
|
racc (~> 1.4)
|
|
59
|
-
nokogiri (1.19.
|
|
61
|
+
nokogiri (1.19.7-x86_64-linux-gnu)
|
|
60
62
|
racc (~> 1.4)
|
|
61
|
-
nokogiri (1.19.
|
|
63
|
+
nokogiri (1.19.7-x86_64-linux-musl)
|
|
62
64
|
racc (~> 1.4)
|
|
65
|
+
oj (3.17.8)
|
|
66
|
+
bigdecimal (>= 3.0)
|
|
63
67
|
prism (1.9.0)
|
|
64
68
|
pry (0.16.0)
|
|
65
69
|
coderay (~> 1.1)
|
|
@@ -92,6 +96,7 @@ PLATFORMS
|
|
|
92
96
|
|
|
93
97
|
DEPENDENCIES
|
|
94
98
|
bundler-audit (~> 0.9.3)
|
|
99
|
+
dotenv (~> 2.8)
|
|
95
100
|
minitest (~> 6.0.2)
|
|
96
101
|
minitest-focus (~> 1.4.1)
|
|
97
102
|
minitest-reporters (~> 1.7.1)
|
|
@@ -111,9 +116,10 @@ CHECKSUMS
|
|
|
111
116
|
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
|
112
117
|
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
|
|
113
118
|
csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
|
|
119
|
+
dotenv (2.8.1) sha256=c5944793349ae03c432e1780a2ca929d60b88c7d14d52d630db0508c3a8a17d8
|
|
114
120
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
115
121
|
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
|
|
116
|
-
httparty (0.24.
|
|
122
|
+
httparty (0.24.3) sha256=5c95cf29ca70d5bfd834e56140ddfca6e94166c3b870cde9c25d157cdb5a00d2
|
|
117
123
|
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
118
124
|
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
|
119
125
|
mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
|
|
@@ -122,18 +128,19 @@ CHECKSUMS
|
|
|
122
128
|
minitest-reporters (1.7.1) sha256=5060413a0c95b8c32fe73e0606f3631c173a884d7900e50013e15094eb50562c
|
|
123
129
|
mocha (3.1.0) sha256=75f42d69ebfb1f10b32489dff8f8431d37a418120ecdfc07afe3bc183d4e1d56
|
|
124
130
|
multi_xml (0.8.1) sha256=addba0290bac34e9088bfe73dc4878530297a82a7bbd66cb44dcd0a4b86edf5a
|
|
125
|
-
nokogiri (1.19.
|
|
126
|
-
nokogiri (1.19.
|
|
127
|
-
nokogiri (1.19.
|
|
128
|
-
nokogiri (1.19.
|
|
129
|
-
nokogiri (1.19.
|
|
130
|
-
nokogiri (1.19.
|
|
131
|
-
nokogiri (1.19.
|
|
132
|
-
nokogiri (1.19.
|
|
131
|
+
nokogiri (1.19.7-aarch64-linux-gnu) sha256=8f5e15d299602456406e1f03a9f3456cceb33a0722811e818d2ee2214eb4c84a
|
|
132
|
+
nokogiri (1.19.7-aarch64-linux-musl) sha256=efe0c3602e6e54521bc21c681930ce5568e2d11203de17400710b2b3ca2e4cb4
|
|
133
|
+
nokogiri (1.19.7-arm-linux-gnu) sha256=7fd1907125691aa89e838cc91161761c758b4e17bb32f0dd9b5515a82cc759af
|
|
134
|
+
nokogiri (1.19.7-arm-linux-musl) sha256=28d0ff0c87b6bb2e56580323a6fb049d5d4a02b94f0958fdd47e9ac146991c77
|
|
135
|
+
nokogiri (1.19.7-arm64-darwin) sha256=f27d7f25f4873fbc3aa35a2cc2fb680c98555fec1925348da439d0869d541142
|
|
136
|
+
nokogiri (1.19.7-x86_64-darwin) sha256=508e81e8c5f84aaa240dce981bf1c43faae60808726f0ce7024ee92effc5cafe
|
|
137
|
+
nokogiri (1.19.7-x86_64-linux-gnu) sha256=25865ccb462f714e712fdf8906fde07849cb6704a808e3d629d75baa5af5dd3b
|
|
138
|
+
nokogiri (1.19.7-x86_64-linux-musl) sha256=464d1f3dfb0d53cf54c0c6a7e23e8e91cf68ec3cafc2b27dc4a7682f2d9bf546
|
|
139
|
+
oj (3.17.8) sha256=6a2d9b93ef289cba6abf8c33173c72920d8dac2799bd89f73c3539947a730306
|
|
133
140
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
134
141
|
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
|
|
135
142
|
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
136
|
-
pushbullet_client (0.0.
|
|
143
|
+
pushbullet_client (0.0.26)
|
|
137
144
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
138
145
|
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
|
|
139
146
|
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
|
data/bin/console
CHANGED
|
@@ -6,6 +6,9 @@ require 'pushbullet'
|
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
|
8
8
|
|
|
9
|
+
require 'dotenv'
|
|
10
|
+
Dotenv.load
|
|
11
|
+
|
|
9
12
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
13
|
require 'pry'
|
|
11
14
|
Pry.start
|
data/lib/pushbullet/client.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'oj'
|
|
2
|
+
|
|
1
3
|
module Pushbullet
|
|
2
4
|
class Client
|
|
3
5
|
include ::Pushbullet::Constants
|
|
@@ -116,14 +118,14 @@ module Pushbullet
|
|
|
116
118
|
end
|
|
117
119
|
|
|
118
120
|
def parse_body(response, path)
|
|
119
|
-
parsed_response =
|
|
121
|
+
parsed_response = Oj.load(response.body) # Purposely not using HTTParty
|
|
120
122
|
|
|
121
123
|
if parsed_response.dig(path.to_s)
|
|
122
124
|
parsed_response.dig(path.to_s)
|
|
123
125
|
else
|
|
124
126
|
parsed_response
|
|
125
127
|
end
|
|
126
|
-
rescue
|
|
128
|
+
rescue Oj::ParseError => _e
|
|
127
129
|
response.body
|
|
128
130
|
end
|
|
129
131
|
|
data/lib/pushbullet/version.rb
CHANGED
data/pushbullet_client.gemspec
CHANGED
|
@@ -22,8 +22,9 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_dependency "httparty", "~> 0.24.
|
|
26
|
-
spec.add_dependency "nokogiri", "~> 1.19.
|
|
25
|
+
spec.add_dependency "httparty", "~> 0.24.3"
|
|
26
|
+
spec.add_dependency "nokogiri", "~> 1.19.7"
|
|
27
|
+
spec.add_dependency "oj", "~> 3.17.8"
|
|
27
28
|
|
|
28
29
|
# Development dependancies
|
|
29
30
|
spec.add_development_dependency "rake", "~> 13.3.1"
|
|
@@ -35,4 +36,5 @@ Gem::Specification.new do |spec|
|
|
|
35
36
|
spec.add_development_dependency "pry", "~> 0.16.0"
|
|
36
37
|
spec.add_development_dependency "webmock", "~> 3.26.2"
|
|
37
38
|
spec.add_development_dependency "bundler-audit", "~> 0.9.3"
|
|
39
|
+
spec.add_development_dependency "dotenv", "~> 2.8"
|
|
38
40
|
end
|
data/test_pushes.rb
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require 'dotenv'
|
|
5
|
+
require 'pushbullet'
|
|
6
|
+
|
|
7
|
+
Dotenv.load
|
|
8
|
+
|
|
9
|
+
# Initialize the client with your access token from .env
|
|
10
|
+
client = Pushbullet::Client.new(
|
|
11
|
+
access_token: ENV['pushbullet_access_token'],
|
|
12
|
+
base_path: 'https://api.pushbullet.com/v2'
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
puts "Fetching your pushes..."
|
|
16
|
+
|
|
17
|
+
# The API response wraps pushes in a 'body' key
|
|
18
|
+
result = client.pushes
|
|
19
|
+
pushes = result['body'] || []
|
|
20
|
+
|
|
21
|
+
if pushes.empty?
|
|
22
|
+
puts "No pushes found."
|
|
23
|
+
else
|
|
24
|
+
puts "Found #{pushes.length} push(es):"
|
|
25
|
+
pushes.each do |push|
|
|
26
|
+
title = push['title'] || push['body'] || '(no title)'
|
|
27
|
+
puts " - [#{push['type']}] #{title}"
|
|
28
|
+
puts " Created: #{push['created']}"
|
|
29
|
+
puts
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
puts "Done."
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.26
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- trex22
|
|
@@ -15,28 +15,42 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.24.
|
|
18
|
+
version: 0.24.3
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.24.
|
|
25
|
+
version: 0.24.3
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: nokogiri
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 1.19.
|
|
32
|
+
version: 1.19.7
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 1.19.
|
|
39
|
+
version: 1.19.7
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: oj
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 3.17.8
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: 3.17.8
|
|
40
54
|
- !ruby/object:Gem::Dependency
|
|
41
55
|
name: rake
|
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -163,6 +177,20 @@ dependencies:
|
|
|
163
177
|
- - "~>"
|
|
164
178
|
- !ruby/object:Gem::Version
|
|
165
179
|
version: 0.9.3
|
|
180
|
+
- !ruby/object:Gem::Dependency
|
|
181
|
+
name: dotenv
|
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
|
183
|
+
requirements:
|
|
184
|
+
- - "~>"
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '2.8'
|
|
187
|
+
type: :development
|
|
188
|
+
prerelease: false
|
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
190
|
+
requirements:
|
|
191
|
+
- - "~>"
|
|
192
|
+
- !ruby/object:Gem::Version
|
|
193
|
+
version: '2.8'
|
|
166
194
|
description: A client for using the Pushbullet API in Ruby. Built form their api documentation.
|
|
167
195
|
https://docs.pushbullet.com/v10/#quick-start. This is an unofficial project.
|
|
168
196
|
email:
|
|
@@ -171,6 +199,7 @@ executables: []
|
|
|
171
199
|
extensions: []
|
|
172
200
|
extra_rdoc_files: []
|
|
173
201
|
files:
|
|
202
|
+
- ".github/dependabot.yml"
|
|
174
203
|
- ".github/workflows/security.yml"
|
|
175
204
|
- ".github/workflows/semgrep.yml"
|
|
176
205
|
- ".gitignore"
|
|
@@ -198,6 +227,7 @@ files:
|
|
|
198
227
|
- lib/pushbullet/users.rb
|
|
199
228
|
- lib/pushbullet/version.rb
|
|
200
229
|
- pushbullet_client.gemspec
|
|
230
|
+
- test_pushes.rb
|
|
201
231
|
homepage: https://github.com/TRex22/pushbullet_client
|
|
202
232
|
licenses:
|
|
203
233
|
- MIT
|
|
@@ -216,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
216
246
|
- !ruby/object:Gem::Version
|
|
217
247
|
version: '0'
|
|
218
248
|
requirements: []
|
|
219
|
-
rubygems_version:
|
|
249
|
+
rubygems_version: 4.0.20
|
|
220
250
|
specification_version: 4
|
|
221
251
|
summary: A client for using the Pushbullet API in Ruby.
|
|
222
252
|
test_files: []
|