From dd959fcfb3a3aa5a01d3d3912b1c976e653b71d8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 4 Oct 2024 23:11:44 +0300 Subject: can post to linkedin initially --- internal/run.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/run.go') 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. -- cgit v1.2.3