summaryrefslogtreecommitdiff
path: root/internal/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/run.go')
-rw-r--r--internal/run.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/run.go b/internal/run.go
index 3beea29..b628d9c 100644
--- a/internal/run.go
+++ b/internal/run.go
@@ -7,6 +7,7 @@ import (
"strings"
"codeberg.org/snonux/gos/internal/config"
+ "codeberg.org/snonux/gos/internal/platforms/linkedin"
"codeberg.org/snonux/gos/internal/platforms/mastodon"
"codeberg.org/snonux/gos/internal/queue"
"codeberg.org/snonux/gos/internal/schedule"
@@ -44,6 +45,18 @@ func Run(ctx context.Context, args config.Args) error {
return err
}
log.Println("Posted", ent, "to", platform)
+ case "linkedin":
+ if args.DryRun {
+ log.Println("Not posting", ent, "to", platform, "as dry-run enabled")
+ continue
+ }
+ if err := linkedin.Post(ctx, args, ent); err != nil {
+ return err
+ }
+ if err := ent.MarkPosted(); err != nil {
+ return err
+ }
+ log.Println("Posted", ent, "to", platform)
default:
// TODO: Once we have LinkedIn implemented, make the above code
// more generic so that it can be used with LinkedIn as well.