← All examples

Action Developer & QA linkedin.com

Export feed post links

Collects authors and direct post links from the currently loaded feed and copies the list to the clipboard.

Code to copy

(function () {
  try {
    var posts = document.querySelectorAll('.feed-shared-update-v2[data-urn], [data-id^="urn:li:activity"]');
    var lines = [];
    posts.forEach(function (p) {
      var urn = p.getAttribute('data-urn') || p.getAttribute('data-id') || '';
      var id = (urn.match(/urn:li:activity:(\d+)/) || [])[1];
      var author = p.querySelector('.update-components-actor__title span[aria-hidden="true"]');
      var name = author ? author.textContent.trim() : '(unknown)';
      if (id) {
        lines.push(name + ' — https://www.linkedin.com/feed/update/urn:li:activity:' + id + '/');
      }
    });
    if (!lines.length) {
      alert('No feed posts found on this page.');
      return;
    }
    var text = lines.join('\n');
    if (navigator.clipboard && navigator.clipboard.writeText) {
      navigator.clipboard.writeText(text).then(function () {
        alert('Copied ' + lines.length + ' post links to the clipboard.');
      });
    } else {
      window.prompt('Feed post links:', text);
    }
  } catch (e) {
    alert('Export failed: ' + e.message);
  }
})();

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Enable the action panel, add a button in the Actions tab and paste the code into it — run it with one click.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases