jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Publicize: Store the syndicated URLs on the local site

Open kraftbj opened this issue 8 years ago • 19 comments

After Publicize has processed a post, let's pass the URLs on social media back to the local site. It is already stored in meta on wp.com, so would need to update Publicize to insert post meta after success and Jetpack to be able to receive it.

This could help tie into indieweb setups that utilize syndicated URLs for webmentions and whatnot.

kraftbj avatar Jun 18 '17 06:06 kraftbj

Added bonus: Could update the Publicize metabox to provide disabled checkboxes on which social media services a post was Pub'd to. Currently, this is a gap between WP.com and Jetpack.

kraftbj avatar Jun 18 '17 06:06 kraftbj

Talking through this more, my suggestion would be:

  1. Sync this data to the same post meta fields that we use on WP.com, with it "frozen" on WP.com so the local site can't override that data on the WP.com side.
  2. Plugins could listen for adding that post meta and grab it.
  3. We add a 3rd-party hook to support Syndicated Links, which is the plugin suggested by the IndieWeb community, or at least work with the developer to make sure we're on the same page.

kraftbj avatar Jun 19 '17 15:06 kraftbj

The post meta currently in use on WP.com may be going away at some point in the future (deferring to the publicize_actions section of the activity log), but the publicize_save_published_action hook on WP.com could be used to trigger a push to JP of the URL or we could access the activity log via an API if needed. (h/t @artpi for catching me up on the current status and direction of Publicize data storage).

kraftbj avatar Jun 21 '17 15:06 kraftbj

I am the developer of Syndication Links. It is a relatively simple plugin. Happy to volunteer or participate.

dshanske avatar Jun 21 '17 18:06 dshanske

This has been a while...has there been any movement on this?

dshanske avatar Jan 17 '18 23:01 dshanske

@dshanske No, not yet.

kraftbj avatar Jan 25 '18 21:01 kraftbj

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

stale[bot] avatar Jul 24 '18 21:07 stale[bot]

Checking in on this issue

dshanske avatar Jan 31 '19 13:01 dshanske

User vote on this thread: https://boffosocko.com/2019/03/28/55747397/

I’m still surprised they don’t return the URLs of where the content got shared for showing on the page with plugins like Syndication Links: https://wordpress.org/plugins/syndication-links/

Hat tip @ryanboren

lancewillett avatar Apr 09 '19 01:04 lancewillett

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

stale[bot] avatar Oct 06 '19 01:10 stale[bot]

@kraftbj Following up on this again

dshanske avatar Dec 11 '19 23:12 dshanske

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

stale[bot] avatar Jun 09 '20 01:06 stale[bot]

I still want this.

dshanske avatar Jun 09 '20 01:06 dshanske

No interest still in this, I guess.

dshanske avatar Aug 01 '20 15:08 dshanske

Please don't confuse lack of activity as lack of interest. It is, however, very low priority and involves an aspect of a feature that crosses both WP.com and Jetpack that does not have a team actively working on. What seems like small changes can cascade to be larger problems.

kraftbj avatar Aug 01 '20 16:08 kraftbj

Just checking in again.

dshanske avatar Feb 27 '24 20:02 dshanske

Thanks for your patience @dshanske . The team working on Jetpack Social has this on their site as part of their Social Posts work (currently in beta).

@pablinos — In addition to saving the shared post for social posts, noting this request specifically for all Publicize (as post meta I would presume).

kraftbj avatar Mar 07 '24 23:03 kraftbj

Yes, currently we're only storing it for Social Notes, but we want to extend this to all publicized posts. Part of the reason for only doing it for notes was that we wanted to test the approach, and also some sites share a lot of posts, and we didn't want to flood them with requests and store extra post meta, especially if they're not going to use it.

pablinos avatar Mar 09 '24 18:03 pablinos

This would be lovely and would avoid a good deal of copy-pasting social links published by jetpack on a couple of my sites.

benharri avatar Aug 20 '24 03:08 benharri

#38702 got us most of the way there. We need to adjust to all for additional post types beyond Social Notes. cc: @spsiddarthan

kraftbj avatar Sep 05 '24 13:09 kraftbj

Yup, we are in the process of doing that. All going well, we should be able to launch it in the next Jetpack release.

spsiddarthan avatar Sep 05 '24 17:09 spsiddarthan

If you could document where you store it, would appreciate

dshanske avatar Sep 05 '24 17:09 dshanske

@dshanske it's stored in _publicize_shares

benharri avatar Sep 05 '24 17:09 benharri

I'm proposing a hook to be added in 39398 that would allow you to grab the URLs when they're saved to the local site db.

If you want to pull the URLs already in the database, the data is stored as post meta in _publicize_shares for each post.

Each attempt at a share is in a multidimensional array. Items with status === 'success' will have a message key with the URL of the successfully shared post. If status === 'failed' the message is the failure reason. service is the social media service used.

If pulling from post meta, this is an example of what it'll look like:

array (
  0 =>
  array (
    'status' => 'success',
    'message' => 'https://mastodon.social/@KraftTesting/113131834695319922',
    'timestamp' => 1726254802,
    'service' => 'mastodon',
    'connection_id' => 25383275,
    'external_id' => '110346155483697827',
    'external_name' => 'KraftTesting',
    'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
    'profile_link' => '',
  ),
  1 =>
  array (
    'status' => 'success',
    'message' => 'https://mastodon.social/@KraftTesting/113131853992527539',
    'timestamp' => 1726255096,
    'service' => 'mastodon',
    'connection_id' => 25383275,
    'external_id' => '110346155483697827',
    'external_name' => 'KraftTesting',
    'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
    'profile_link' => '',
  ),
  2 =>
  array (
    'status' => 'success',
    'message' => 'https://mastodon.social/@KraftTesting/113131884688679461',
    'timestamp' => 1726255565,
    'service' => 'mastodon',
    'connection_id' => 25383275,
    'external_id' => '110346155483697827',
    'external_name' => 'KraftTesting',
    'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
    'profile_link' => '',
  ),
)

If you're wanting to hook upon save, you can do something like:

add_action( 'jetpack_publicize_share_urls_saved', 'bk_test_save', 10, 2);

function bk_test_save( $urls ) {
	if ( $urls ) {
		update_option( 'bk_test_urls', $urls );
	} else {
		update_option( 'bk_test_urls', 'nothing present');
	}
}

The $urls value in the hook approach looks like (once merged):

array (
  0 =>
  array (
    'url' => 'https://mastodon.social/@KraftTesting/113131834695319922',
    'service' => 'mastodon',
  ),
)

@dshanske Does that work for your needs or are there some changes that we can consider you'd suggest?

kraftbj avatar Sep 13 '24 19:09 kraftbj

That's perfect. As long as it can be found.

dshanske avatar Sep 13 '24 21:09 dshanske