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

Enable users to follow any list #13

Open
jonodrew opened this issue May 9, 2021 · 6 comments
Open

Enable users to follow any list #13

jonodrew opened this issue May 9, 2021 · 6 comments

Comments

@jonodrew
Copy link
Collaborator

jonodrew commented May 9, 2021

Users should be able to follow any list by hitting some endpoint, probably api/list/{list_id}

Since the callback URL for Twitter authentication has to be registered with Twitter, we can't dynamically generate it. That means the flow will have to be homepage -> authenticate -> select list to follow (how?) -> process list as usual, unless I can pass some kind of context through the authentication process - ie, so that when Twitter returns the response, I know what list the user was trying to follow when they hit the authentication flow.

If I can't do that, there will have to be more of a frontend than there currently is, which represents a fairly chunky bit of work. Specifically, working out how a user selects which list they want to follow will be a tricky experience. There will also have to be a new bit of code at the backend.

@edsaperia
Copy link

Here is an alternative that be simpler, if it can work:
in github we have a little csv that holds a table of {twitter list, url slug}, for example something like:

1358187814769287171, data_collective_members
1374362955635171329, EPDS_board

And then when a user goes to twitterlistfollower.com/url_slug, they follow the associated list. So in other words, there is a defined set of lists that work, and the admin (manually?) sets the callback URLs with Twitter.

@jonodrew
Copy link
Collaborator Author

jonodrew commented May 29, 2021

User clicks a link --> server returns 200. HTML: "If you are not redirected in {n} seconds, click this link", potentially .js as well to automatically redirect user. Set a cookie to identify user. User authenticates, is redirected by twitter to /redirect.

Redirect examines cookie, matches up current with original request, and then kicks off list-following-process

@edsaperia
Copy link

Can we have something like "Click here to follow everyone in "[listname]" on Twitter" instead?

@jonodrew
Copy link
Collaborator Author

jonodrew commented Jun 6, 2021

I've spent the week fighting with the web framework I'm using to return some HTML so that the user has something to click on. I'll keep working on it for now, I'm sure there's an easy way that I'm just missing.

@edsaperia
Copy link

Thank you for your perseverance 🙏

@jonodrew
Copy link
Collaborator Author

I think with the current architecture this isn't going to work. To get to something similar to https://megablock.xyz/, I am going to need to add a front-end application to deal with users. I'll put it in its own repo and name it appropriately, and it'll just be a small Flask app to manage the user session effectively. The Flask app will interact with this queueing system.

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

No branches or pull requests

2 participants