huginn_bluesky_authorfeed_agent 0.1.O → 0.1.10
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9f999e7c6bd7011a77378d092234bf853828dc0b11b547fa2ba368232c6d188
|
4
|
+
data.tar.gz: b98122e3b2e327d841ec34b74e3e80f40a2e519ae3a9770e6415f4d8609b22c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 516e497af4bf38a8195a37652c4d84a3bb544a6e43ac58d5e78a887820eb9841a39611b7f5110d558bded04dfed424709797b05c8af3d8fe6b4c6f14dcc0b7a4
|
7
|
+
data.tar.gz: 35d6f3f1888b315d158cebfb846e010686dace82e0d78e7fff66fe8a909e78273bff48dbea90efa0cdeffeaff7fe79731835a21e8f85a90619587592ebc7aa83
|
@@ -7,17 +7,14 @@ module Agents
|
|
7
7
|
|
8
8
|
description do
|
9
9
|
<<-MD
|
10
|
-
The Bluesky
|
11
|
-
|
12
|
-
To be able to use this Agent you need to authenticate with Twitter with [twurl](https://github.com/twitter/twurl).
|
13
|
-
|
14
|
-
You must also specify a `message` parameter, you can use [Liquid](https://github.com/huginn/huginn/wiki/Formatting-Events-using-Liquid) to format the message.
|
15
|
-
Additional parameters can be passed via `parameters`.
|
10
|
+
The Bluesky Authorfeed Agent checks user's feed.
|
16
11
|
|
17
12
|
`debug` is used for verbose mode.
|
18
13
|
|
19
14
|
`handle` is mandatory for authentication.
|
20
15
|
|
16
|
+
`limit` is needed to limit the number of results.
|
17
|
+
|
21
18
|
`user` is the wanted user you want to check.
|
22
19
|
|
23
20
|
`app_password` is mandatory for authentication.
|
@@ -31,6 +28,39 @@ module Agents
|
|
31
28
|
Events look like this:
|
32
29
|
|
33
30
|
{
|
31
|
+
"post": {
|
32
|
+
"uri": "at://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/app.bsky.feed.post/XXXXXXXXXXXXX",
|
33
|
+
"cid": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
34
|
+
"author": {
|
35
|
+
"did": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
36
|
+
"handle": "hihouhou.bsky.social",
|
37
|
+
"viewer": {
|
38
|
+
"muted": false,
|
39
|
+
"blockedBy": false,
|
40
|
+
"followedBy": "at://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/app.bsky.graph.follow/XXXXXXXXXXXXX"
|
41
|
+
},
|
42
|
+
"labels": [
|
43
|
+
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"record": {
|
47
|
+
"text": "test for authorfeed agent (huginn)",
|
48
|
+
"$type": "app.bsky.feed.post",
|
49
|
+
"langs": [
|
50
|
+
"fr"
|
51
|
+
],
|
52
|
+
"createdAt": "2023-12-15T20:21:50.150Z"
|
53
|
+
},
|
54
|
+
"replyCount": 1,
|
55
|
+
"repostCount": 0,
|
56
|
+
"likeCount": 0,
|
57
|
+
"indexedAt": "2023-12-15T20:21:50.150Z",
|
58
|
+
"viewer": {
|
59
|
+
},
|
60
|
+
"labels": [
|
61
|
+
|
62
|
+
]
|
63
|
+
}
|
34
64
|
}
|
35
65
|
MD
|
36
66
|
|
@@ -39,6 +69,7 @@ module Agents
|
|
39
69
|
'user' => '',
|
40
70
|
'debug' => 'false',
|
41
71
|
'handle' => '',
|
72
|
+
'limit' => '10',
|
42
73
|
'app_password' => '',
|
43
74
|
'expected_receive_period_in_days' => '2',
|
44
75
|
}
|
@@ -48,6 +79,7 @@ module Agents
|
|
48
79
|
form_configurable :debug, type: :boolean
|
49
80
|
form_configurable :app_password, type: :string
|
50
81
|
form_configurable :handle, type: :string
|
82
|
+
form_configurable :limit, type: :string
|
51
83
|
form_configurable :expected_receive_period_in_days, type: :string
|
52
84
|
def validate_options
|
53
85
|
unless options['user'].present?
|
@@ -62,6 +94,10 @@ module Agents
|
|
62
94
|
errors.add(:base, "handle is a required field")
|
63
95
|
end
|
64
96
|
|
97
|
+
unless options['limit'].present?
|
98
|
+
errors.add(:base, "limit is a required field")
|
99
|
+
end
|
100
|
+
|
65
101
|
if options.has_key?('debug') && boolify(options['debug']).nil?
|
66
102
|
errors.add(:base, "if provided, debug must be true or false")
|
67
103
|
end
|
@@ -129,7 +165,7 @@ module Agents
|
|
129
165
|
def get_feed()
|
130
166
|
|
131
167
|
did = generate_did(interpolated['handle'])
|
132
|
-
uri = URI.parse("https://bsky.social/xrpc/app.bsky.feed.getAuthorFeed?actor=#{generate_did(interpolated['user'])}&limit
|
168
|
+
uri = URI.parse("https://bsky.social/xrpc/app.bsky.feed.getAuthorFeed?actor=#{generate_did(interpolated['user'])}&limit=#{interpolated['limit']}")
|
133
169
|
request = Net::HTTP::Get.new(uri)
|
134
170
|
request["Authorization"] = "Bearer #{generate_api_key(did)}"
|
135
171
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_bluesky_authorfeed_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Germain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubygems_version: 3.3.3
|
86
86
|
signing_key:
|