Post content from Plone to social media?

I looked for a social media plugin for Plone that includes Facebook, Twitter, and LinkedIn, and when an author publishes a press release in Plone, then it will automatically publish that content (or abbreviated versions with a link to the Plone press release) to the social media accounts owned by the organization.

I found sc.social.like, but it seems to do other kinds of integration, like adding open graph tags and embedding Facebook and Twitter timelines, but not automatic posting.

It seems that the way to do this nowadays is for the content author, instead of doing automatic posting to social media, would add a ShareThis (or similar) widget to the site, view their content in Plone, and click a button to share on their social media accounts through the ShareThis widget. Is that about right?

We looked into doing something like this a while back, but it got complicated very quickly. At the time, I could not find an existing add-on to do this, and we estimated almost 30 hours to build one. We ended up installing AddThis and putting in an alert that would remind admins to share the post on social media.

I'd say do not do it;

  • social media change their API regularly (280 chars anyone?)
  • most marketeers or social media staff will have their preferred solution already, with stats and the like. Eg. Hootsuite or competitors

So, it's easier to use Collections to create a nicely targeted RSS feed (Images for Instagram, news items for twitter, whatever suits best) and let Hootsuite or others read those and handle them, and feed them to whatever social media accounts you have connected there. Set up as many RSS feeds as you need for different kinds of posts.

EDIT: of course you can also use restapi to get stuff into Hootsuite et al, if you're more an avocado toast person. Principle remains the same: use Collections to get the desired output, feed it into the service of your choice and let them handle the ever-changing social media details.

If you need some mangling, IFTTT or Zapier or similar will do that happily for you, and they can also post on twitter and the like. But for proper stats, scheduling, and stuff, a specialist service does bring benefits.

1 Like

Having chased such API targets for a couple of years building FB games, web portals for multiplayer PC games and mobile games, one should not assume those stay stable for longer than 30 days into the future. This is fine for rolling release software, though, as you just simply change the version pinning of the social media platform provided library / SDK and rearchitect around the change and roll it out.

Plone is not an agile cutter of a pirate ship to chase after such annoying trivialities. Like the tanker it is, it should concentrate on getting the heavy lifting base stuff right.

we used collective.twitter.tweet in the past, but it quickly proved it's a bad a idea to tweet automatically (different requirements for titles and hashtags).

BTW, sc.social.like can add widgets for those social networks you mentioned above; you just have to enable that on the control panel.

Thank you, everyone, for the feedback and suggestions. I've been burned by changing and deprecated social media APIs in the past, so I'll punt this one to the third party social media experts.

Anyone knows about an react integration or third part integration to share news in social networks?

This for instance: GitHub - codesyntax/volto-social-sharing: Volto social sharing integration addon.

Ok, I did not tried yet to install because it was not the way I learned in volto. (add the component to packages.json).

So, in frontend/src/config.js it is exported the function applyConfig.

The injection we have to do is in this file is to also export settings?


import SocialSharing from '@codesyntax/volto-social-sharing/SocialSharing';

export const settings = {
  ...defaultSettings,
  appExtras: [
    ...defaultSettings.appExtras,
    {
      match: '',
      component: SocialSharing,
    },
  ],
};

You can do it in your applyConfig method too. Append the required object to the appExtras.

1 Like

I tried to do this and it is not working.

import '@plone/volto/config';
import SocialSharing from '@codesyntax/volto-social-sharing/SocialSharing';

export default function applyConfig(config) {
  return (config = {
    ...config,
    appExtras: [
      ...config.appExtras,
      {
        match: '',
        component: SocialSharing,
      },
    ],
  });
}

The error looks like to be in the way I am appending to appExtras.

webpack 5.76.1 compiled successfully in 49029 ms
sswp> Handling Hot Module Reloading
TypeError: config.appExtras is not iterable

This is working:

import '@plone/volto/config';
import SocialSharing from '@codesyntax/volto-social-sharing/SocialSharing';

export default function applyConfig(config) {
  config.settings = {
    ...config.settings,
appExtras: [
    ...config.settings.appExtras,
    {
      match: '',
      component: SocialSharing,
    },
  ],
  }
  return config;
}

What you think about adding to readme?

yes of course.