Save source name when adding syndication target
This commit is contained in:
21
slices/micropub/queries/posts/syndication_url_to_source.rb
Normal file
21
slices/micropub/queries/posts/syndication_url_to_source.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
module Micropub
|
||||
module Queries
|
||||
module Posts
|
||||
class SyndicationUrlToSource
|
||||
def call(url:)
|
||||
if url.match("https://social.dnitza.com")
|
||||
return :mastodon
|
||||
end
|
||||
|
||||
if url.match("https://bsky.social")
|
||||
return :bluesky
|
||||
end
|
||||
|
||||
if url.match("https://gist.github.com")
|
||||
return :gist
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user