+10
app/at_uri.rb
+10
app/at_uri.rb
···
2
2
class InvalidURIError
3
3
end
4
4
5
+
TID_PATTERN = /^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/
6
+
5
7
attr_reader :repo, :collection, :rkey
6
8
7
9
def initialize(uri)
···
24
26
25
27
def to_s
26
28
@uri
29
+
end
30
+
31
+
def has_valid_tid?
32
+
@rkey =~ TID_PATTERN
33
+
end
34
+
35
+
def is_post?
36
+
@collection == 'app.bsky.feed.post' && has_valid_tid?
27
37
end
28
38
end
29
39
+1
-1
app/importers/base_importer.rb
+1
-1
app/importers/base_importer.rb