beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Publicize doesn't trigger when new post is made #12

Closed michaeltieso closed 7 years ago

michaeltieso commented 7 years ago

Hiya. Not sure if it's possible/planned but I was hoping that for each new Instagram post that it would automatically post to Twitter & Facebook. I prefer this method only because it shares my blogs link vs sharing it directly on Instagram. Alternatively I can use IFTTT to create the trigger but wanted to see if this was possible.

beaulebens commented 7 years ago

This is actually intentional/known behavior. The importers set the WP_IMPORTING constant while pulling content from remote services since they are indeed importing content. Publicize takes note of this constant to avoid doing something like sending out a Publicize event for every imported post (imagine that for a bulk import 😱 ).

I've tried running this without that constant, and it's very easy to end up in an infinite loop (post to Twitter, import from Twitter, Publicize to Twitter, etc). Theoretically we could add duplicate detection to avoid that loop, but right now using the constant and just never triggering Publicize feels like the safer and more "correct" thing to do.

After all of that, IFTTT would totally be a reasonable solution :)