Add blue sky as a syndication source

This commit is contained in:
2023-11-06 18:06:47 +11:00
parent 1be98a056a
commit 2cccd2d99a
11 changed files with 108 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ module Adamantium
include Deps["settings",
"syndication.mastodon",
"syndication.blue_sky",
add_post_syndication_source: "commands.posts.add_syndication_source",
send_to_dayone: "syndication.dayone",
]
@@ -23,6 +24,12 @@ module Adamantium
add_post_syndication_source.call(post_id, :mastodon, res.value!) if res.success?
end
if syndicate_to.include? :blue_sky
res = blue_sky.call(post: post)
add_post_syndication_source.call(post_id, :blue_sky, res.value!) if res.success?
end
if post[:category].include? "weekly"
send_to_dayone.call(name: post[:name], content: post[:content])
end
@@ -35,6 +42,7 @@ module Adamantium
def syndication_targets(syndicate_to)
targets = []
targets << :mastodon if syndicate_to.any? { |url| settings.mastodon_server.match(/#{url}/) }
targets << :blue_sky if syndicate_to.any? { |url| settings.blue_sky_url.match(/#{url}/) }
targets
end
end