Showing all replies on the same page. #684

Closed
opened 2022-08-12 23:47:58 -04:00 by CortexReaver · 7 comments
CortexReaver commented 2022-08-12 23:47:58 -04:00 (Migrated from github.com)

Right now "more replies" leads you to a rabbithole of reply pages, to get back to original tweet for reading other comments you have to hit "back" multiple times in browser. Is it technically not possible to make it like original twitter at the moment?
Also what about hierarchical replies dropdown, like LiveJournal has? I know that Twitter is very different from LJ, and same reply can be addressed to multiple accounts but it will be great if possible.

Right now "more replies" leads you to a rabbithole of reply pages, to get back to original tweet for reading other comments you have to hit "back" multiple times in browser. Is it technically not possible to make it like original twitter at the moment? Also what about hierarchical replies dropdown, like LiveJournal has? I know that Twitter is very different from LJ, and same reply can be addressed to multiple accounts but it will be great if possible.
ericpa06 commented 2022-09-27 14:16:00 -04:00 (Migrated from github.com)

Came here just to searching for this precise feature. It would be handy if was added.

Came here just to searching for this precise feature. It would be handy if was added.
jadedgnome commented 2022-10-01 23:11:25 -04:00 (Migrated from github.com)

I use "Infy Scroll" browser extension to load those url pages continuously.

I use "Infy Scroll" browser extension to load those url pages continuously.
ericpa06 commented 2023-01-31 19:54:05 -05:00 (Migrated from github.com)

For those interested, I used ChatGPT to create a script that does precisely this. It might not be the best implementation, so if anyone knows how to improve it, be my guess, please. To install it, just download some userscript extension, such as Tampermonkey and copy this into a new script

// ==UserScript==
// @name        Nitter Fixer
// @namespace   Violentmonkey Scripts
// @include     *nitter.*status*?scroll=true
// @grant       none
// @version     1.0
// @author      -
// @description 31/01/2023, 21:45:25
// ==/UserScript==

function showMoreReplies() {
  // Select all .more-replies elements on the page
  const moreRepliesElements = document.querySelectorAll('.more-replies');

  // Iterate over each element
  moreRepliesElements.forEach(element => {
    // Check if the element already has a .replies sibling
    if (!element.previousElementSibling.classList.contains('replies')) {
      // Get the URL of the page that would be opened if you clicked on the element
      const url = element.querySelector('.more-replies-text').getAttribute('href');

      // Use the fetch function to retrieve the HTML content of the page
      fetch(url)
        .then(response => response.text())
        .then(html => {
          // Create a temporary element to hold the retrieved HTML content
          const tempElement = document.createElement('div');
          tempElement.innerHTML = html;

          // Select the .replies element from the temporary element
          const repliesElement = tempElement.querySelector('.replies');

          // Insert the .replies element as a sibling of the .more-replies element
          element.parentElement.insertBefore(repliesElement, element);

          // Hide the .more-replies element
          element.style.display = 'none';
        });
    }
  });
}

// Run the showMoreReplies function continuously
setInterval(function() {
  showMoreReplies();
}, 1000);

Update: At request I modified the script to only run on pages that end on "?scroll=true", such as:
https://nitter.net/netflix/status/1620814232768880650?scroll=true

If you don't want this behavior, just remove that part from the code.

For those interested, I used ChatGPT to create a script that does precisely this. It might not be the best implementation, so if anyone knows how to improve it, be my guess, please. To install it, just download some userscript extension, such as Tampermonkey and copy this into a new script ``` // ==UserScript== // @name Nitter Fixer // @namespace Violentmonkey Scripts // @include *nitter.*status*?scroll=true // @grant none // @version 1.0 // @author - // @description 31/01/2023, 21:45:25 // ==/UserScript== function showMoreReplies() { // Select all .more-replies elements on the page const moreRepliesElements = document.querySelectorAll('.more-replies'); // Iterate over each element moreRepliesElements.forEach(element => { // Check if the element already has a .replies sibling if (!element.previousElementSibling.classList.contains('replies')) { // Get the URL of the page that would be opened if you clicked on the element const url = element.querySelector('.more-replies-text').getAttribute('href'); // Use the fetch function to retrieve the HTML content of the page fetch(url) .then(response => response.text()) .then(html => { // Create a temporary element to hold the retrieved HTML content const tempElement = document.createElement('div'); tempElement.innerHTML = html; // Select the .replies element from the temporary element const repliesElement = tempElement.querySelector('.replies'); // Insert the .replies element as a sibling of the .more-replies element element.parentElement.insertBefore(repliesElement, element); // Hide the .more-replies element element.style.display = 'none'; }); } }); } // Run the showMoreReplies function continuously setInterval(function() { showMoreReplies(); }, 1000); ``` Update: At request I modified the script to only run on pages that end on **"?scroll=true"**, such as: https://nitter.net/netflix/status/1620814232768880650?scroll=true If you don't want this behavior, just remove that part from the code.
jadedgnome commented 2023-02-01 00:05:39 -05:00 (Migrated from github.com)

what prompts did you use to get that?

> what prompts did you use to get that?
ericpa06 commented 2023-02-01 16:37:38 -05:00 (Migrated from github.com)

I don't quite remember the exact words, but I had to tried a few times until I was able to make the ChatGPT understand what I was going for. Also, I posted the part of HTML of nitter page that I wanted the script to change and said something like: I would like to load the "More Replies" right into this page, and I tried until I was able to get what I wanted.

I don't quite remember the exact words, but I had to tried a few times until I was able to make the ChatGPT understand what I was going for. Also, I posted the part of HTML of nitter page that I wanted the script to change and said something like: I would like to load the "More Replies" right into this page, and I tried until I was able to get what I wanted.
zedeus commented 2023-02-01 19:22:50 -05:00 (Migrated from github.com)

I would hate it if people started using this on nitter.net as it would often result in dozens of requests per page load. With that said there is one thing you can improve. By adding ?scroll=true to the url, Nitter only fetches the replies and not the full original thread. Please edit your script.
https://github.com/zedeus/nitter/blob/master/public/js/infiniteScroll.js#L38
https://github.com/zedeus/nitter/blob/master/src/routes/status.nim#L22

I would hate it if people started using this on nitter.net as it would often result in dozens of requests per page load. With that said there is one thing you can improve. By adding `?scroll=true` to the url, Nitter only fetches the replies and not the full original thread. Please edit your script. https://github.com/zedeus/nitter/blob/master/public/js/infiniteScroll.js#L38 https://github.com/zedeus/nitter/blob/master/src/routes/status.nim#L22
zedeus commented 2025-11-23 17:25:49 -05:00 (Migrated from github.com)

I don't think "more replies" is even a thing anymore, closing.

I don't think "more replies" is even a thing anymore, closing.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PAS/nitter#684
No description provided.