Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a home timeline for followed accounts #363

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

FIGBERT
Copy link

@FIGBERT FIGBERT commented Mar 20, 2021

This PR introduces a cookie-based system for following Twitter users via Nitter. Followed accounts are stored in a cookie (à la Teddit), and displayed at the base path.

  • New Routes
    • home.nim
      • Served at the base path (/)
      • Shows a search box (as before) if the user is not following anybody
      • If the user is following anyone on Twitter, it instead shows a timeline. There's an additional tab available to list the users you are following (similar to the current lists.nim view).
    • follow.nim
      • Includes two routes, served at /follow/@name and /unfollow/@name
      • Similar to the /enablehls route, navigating to these pages modifies a cookie and then redirects the user back to the referrer.
      • As expected, the /follow/@name route adds a user to the following cookie and /unfollow/@name removes them.
  • New Preferences
    • following
      • The following cookie, in the new "Timeline" section, is a comma-separated list of usernames to follow.
      • Exposing it directly through the /settings route enables users to quickly and easily transfer instances while keeping their list of followers.

@acarasimon96
Copy link
Contributor

acarasimon96 commented Aug 30, 2021

Hey there, I tested this PR last night and it works flawlessly. There are a couple suggestions to improve the UX of your work:

  • Add unfollow buttons on each account in the following tab, which could help Nitter users with large numbers of accounts in their home feeds. If possible, adding a bulk unfollow feature would be nice too, preferably without the use of JS.
  • The following accounts textbox in settings should be bigger. I find it too small if one has lots of followed accounts in their home feed.

Other than that, it looks good to me. I haven't checked if the RSS feature works with this, but it would be useless for feed readers that don't support using cookies while fetching feeds anyway. I really hope that this PR gets merged soon, given that Nitter hasn't had any new shiny features in a long time.

@acarasimon96
Copy link
Contributor

Just a quick update: the home feed suddenly stopped showing tweets when I'm following at least 20 accounts. This is caused by the 500-character limit for search queries, which was explained in #310, and there is no way to work around that at this time.

@Salastil
Copy link

Salastil commented Jan 16, 2022

A lot of merge conflicts because of the recent spat of commits in the master branch, enough of them that I can't really fumble my way through dealing with them.

@acarasimon96
Copy link
Contributor

@Salastil You can try testing this PR with my fork Nitter FT. This feature is already merged in that repo with the latest wave of commits, and currently it works for me just like during Zed's hiatus.

@FIGBERT
Copy link
Author

FIGBERT commented Jan 16, 2022

I'm working on bringing this up to date with master – glad to have Zed back!

@zedeus
Copy link
Owner

zedeus commented Jan 16, 2022

Before this feature can be added to Nitter, I need to finish rewriting all the parser code to be more efficient, and add support for multi-user timelines with more than the ~20 users limit. Work has already begun on this, see 111927a and cdf49dc. For the 20 user limit problem I already implemented a prototype solution a while back, distributing usernames into buckets efficiently to minimize amount of requests, but the main problem was how to merge results and support pagination efficiently.

@FIGBERT
Copy link
Author

FIGBERT commented Jan 19, 2022

Rebase successful!

@Salastil
Copy link

Salastil commented May 5, 2022

Mind rebasing this again since commits seem to be more cosmetic changes to themes after the Feb 11th breakage?

FIGBERT added 10 commits May 5, 2022 23:27
The timeline section currently has one preference, following, which is a
comma-separated field of people to display on the home timeline.
Currently just a copy of timeline.nim that takes names from the
following cookie rather than the url.
The buttons currently send a post request to two new routes, /follow and
/unfollow, which immediately redirect back to the referrer. They do not
modify the list of followers, but do accurately change based on whether
or not the viewed profile is currently in the list of followers.
The router_utils savePref function didn't work in my testing, so I am
setting the cookie directly through Jester's setCookie procedure.
@FIGBERT
Copy link
Author

FIGBERT commented May 8, 2022

Rebased again, @Salastil. @zedeus how is work going on the other features that need to be implemented before merging this?

@Salastil
Copy link

Salastil commented May 8, 2022

/home/nitter/nitter/src/views/profile.nim(16, 12) template/generic instantiation of `buildHtml` from here
/home/nitter/nitter/src/views/profile.nim(33, 46) Error: undeclared identifier: 'username'

Seems to be throwing an error when building.

@FIGBERT
Copy link
Author

FIGBERT commented May 9, 2022

Thought I caught all the uses of Profile... oh well. Updated, should compile now.

@FIGBERT
Copy link
Author

FIGBERT commented Jun 13, 2022

Poke! @acarasimon96 @Salastil @zedeus – what's the outlook on merging?

@PAI5REECHO
Copy link

@FIGBERT I gave this a try using 3056d7c to build a Docker image. Accessing any profile just completely times out for me:

/src # curl -si http://localhost:8080 | head -n 3
HTTP/1.1 200 OK
content-type: text/html;charset=utf-8
Content-Length: 3606
/src # curl -i http://localhost:8080/elonmusk
...

@FIGBERT
Copy link
Author

FIGBERT commented Jul 16, 2022

@PAI5REECHO: I just rebuilt the image from the same commit with Docker, not experiencing any timeout issues with profiles.

I believe this is ready to continue.

@HookedBehemoth
Copy link
Contributor

Works pretty well on my instance.
The only issue I noticed is that with long names the un-/follow button moves down.
image

@nickelswitte
Copy link

Hello,
is there any chance of this being merged in the future? I would love to have this feature :)

@aquova
Copy link

aquova commented Sep 23, 2022

I've checked out this branch for my own instance, and everything seems to be working well. The only limitation is that the feed ceases to work if you have >20 accounts followed, as noted.

@Salastil
Copy link

image

The timeline seems to be stepping on the toes of error reporting, the current fracas over the search API being deprecated caused the instance to get rate limited. The instance got rate limited but this error is only visible if you pull up a new private instance with no timeline.

@Salastil
Copy link

Salastil commented May 5, 2023

@FIGBERT Going to need a rebase again since the graphql changes break it from compiling.

@ButteredCats
Copy link

Hi,

I'm very new to doing things on Github and interacting with other people's work so I apologize if this is against the norm or I did it in a weird way. I wanted to have this feature on Nitter so instead of waiting around I decided I'd take a crack at making it work myself: https://github.com/ButteredCats/nitter/tree/graphql_follows

I'm no expert coder so hopefully I merged everything correctly but it's currently up and running on my instance: https://nitter.catsarch.com

@HookedBehemoth
Copy link
Contributor

Awesome!
From a quick test, it seems that 25 accounts is the limit there now.

@ButteredCats
Copy link

What list of people are you using? I'm up to a list of 39 trying to test this and everything works for me, including trying it as a multifeed on other instances.

This is the list I'm using:
ZestyLemonss,accelldraws,kherspurrs,DaHeckSaJerry,maiathoustra,EvenSteven_H,softfuzzymike,pinkpoffinz,SaneFurryStrug,GlasssShine,goobysart,rolo_stuff,crabula1,uefa,cnn,foxnews,cnnbrk,CNNPolitics,ABC,abc_es,CBS,BBC,zeitonline,Gazzetta_it,DiarioAS,elmundoes,swissteam,FlySWISS,Marca,swissinfo,equipedefrance,LeTemps,FuW_News,WSJbusiness,SkyNewsBiz,APBusiness,SkySportNews,PeterbiltMotors,HISTORY

@zedeus
Copy link
Owner

zedeus commented Nov 1, 2023

Unless the behavior has changed recently, Twitter silently cuts off the search query at 500 characters so it may seem like it works but it doesn't include all of the accounts.

@ButteredCats
Copy link

Ah, my understanding of the problem was that the feed stopped showing up entirely. My bad.

I don't think I have anywhere near the skills or familiarity with the code to do anything about that myself but if any changes get made I'd be happy to help test them out.

Regardless, for the forseable future I plan to have this feature on my instance despite the limitations.

@anyone00
Copy link

anyone00 commented Nov 1, 2023

Ah, my understanding of the problem was that the feed stopped showing up entirely. My bad.

That's true, before it was showing nothing when your list exceeded the limit, I don't know the hiding was happening in nitter or twitter side though.

@zedeus
Copy link
Owner

zedeus commented Nov 1, 2023

Twitter side, the new GraphQL endpoint trims it while the old ones returned nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants