Use AI to Analyze All Comments in a LinkedIn Thread
This blog post describes how you can have an LLM analyze comments on a long LinkedIn thread.
The first step is to get LinkedIn to load all of the comments. This requires a few things:
- Switch from "Most relevent" to "Most recent" view.
- Load all the comments.
- Scroll to the bottom of the page and, if necessary, click Load more until there are no more comments to load.
- Click any "Previous comments" and "Additional comments" links that appear for existing comments.
- Click any "More" links to expand the comments.
- To avoid exceeding LLM prompt length limits, print the page to a PDF or copy the text into a file that you can upload.
- Prompt the LLM and upload the file.
I asked someone write some JavaScript to automate the first two steps. Unfortunately, it doesn't seem to work as a bookmarklet.
- //TODO: Update: https://drive.google.com/file/d/1fDjcm8197wcowMFE-wqzI7Clh0TVh6r7/view?usp=drive_link
To use this in google's chrome desktop browser:
- Load the thread in a desktop browser. You can use the Copy link to post option that appears when you click the three vertical dots at the top right of the post to copy its URL into the operating system clipboard and paste that into the address bar of the new browser window that appears when you press CTRL+N.
- Copy the script into your operating system clipboard.
- Return to the thread and press F12 to open developer tools. There may be many warnings that you can probably ignore.
- In the developer tools panel, click Console.
- Paste the script into the text box at the bottom of developer tools. You may get a warning about pasting scripts, in which case you can follow the instructions provided with that warning to enable a setting that allows pasting. You can probably ignore additional warnings that may appear.
For threads with thousands of comments, this can take quite some time, gets slower as more comments load, uses a great deal of memory, and may cause the browser to crash. You may want to drag the browser tab onto a second screen and leave it running in the foreground there while you do other work.
You can press F12 again to hide the developer tools.
Test threads:
- Relatively short: https://www.linkedin.com/posts/yann-lecun_as-many-of-you-have-heard-through-rumors-activity-7397020300451749888-2lhA
- Incredibly long: https://www.linkedin.com/feed/update/urn%3Ali%3Aactivity%3A7269737472706703360
An example prompt for the LLM might be something like:
Using less than 1200 characters, summarize points in comments in the attached file as a simple bulleted list. Indicate percentages of comments that agree and disagree with the post and each significant perspective in the comments.
Original attempt:
To get an entire slashdot thread in a desktop browser:
- Log in to slashdot.org.
- Access the thread.
- In the header under the article body, drag the two arrows under Full Abbreviated High all the way to the right (under )Hidden)
Test thread: