Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

feat: add more credentials#18

Merged
12joan merged 6 commits into
12joan:mainfrom
nickchen120235:add-credentials
Jul 7, 2023
Merged

feat: add more credentials#18
12joan merged 6 commits into
12joan:mainfrom
nickchen120235:add-credentials

Conversation

@nickchen120235
Copy link
Copy Markdown
Contributor

@nickchen120235 nickchen120235 commented Jul 6, 2023

Closes #2

This PR introduces all four key pairs found here

Testing Instructions

No functionality changes. Everything should still work.

Copy link
Copy Markdown
Owner

@12joan 12joan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one small typo

Comment thread src/twitter.ts Outdated
Co-authored-by: Joe Anderson <joe@anderbell.studio>
@nickchen120235 nickchen120235 marked this pull request as draft July 7, 2023 02:43
@nickchen120235
Copy link
Copy Markdown
Contributor Author

I'm converting this to draft temporarily because I found some other tokens that might work. zedeus/nitter#925

I'll be back if any (or none) of them works.

@nickchen120235
Copy link
Copy Markdown
Contributor Author

So both the developer.twitter.com and the ipad token will return 20 tweets per request. But the tweetdeck token usually returns less than 20 tweets.

@12joan
Copy link
Copy Markdown
Owner

12joan commented Jul 7, 2023

That's interesting. I'll let you decide what's best here.

Incidentally, I'm liking Twitter's new tagline, courtesy of DuckDuckGo.
Search result for TweetDeck. The text under the result is 'Something went wrong, but don't fret — let's give it another shot.'

@nickchen120235
Copy link
Copy Markdown
Contributor Author

nickchen120235 commented Jul 7, 2023

Here's my plan

  1. Remove caching for the access token (since they are hard-coded)
  2. Remove caching for guest token (this may add a little more overhead but we can make sure that the randomly-picked access token are actually used)
  3. We can keep user id cached since it should not change when different token is given

If this sounds like a plan, we can keep the tweetdeck key but give it a lower weight.

@12joan
Copy link
Copy Markdown
Owner

12joan commented Jul 7, 2023

That sounds all right to me. No need to remove guest token caching, since the cache is keyed on the access token.

@12joan
Copy link
Copy Markdown
Owner

12joan commented Jul 7, 2023

Are we confident that the hardcoded access tokens are just as unlikely to change as the raw client credentials?

@nickchen120235
Copy link
Copy Markdown
Contributor Author

nickchen120235 commented Jul 7, 2023

As far as I can tell, the bearer token for the frontend (twitter.com) hasn't changed untill all hell breaks loose, so I think those tokens are unlikely to change.

However, considering the Tesla guy is constantly unplugging any means of twitter profile scraping, the tokens may or may not be invalid in the near future.

@nickchen120235 nickchen120235 marked this pull request as ready for review July 7, 2023 15:12
Comment thread src/twitter.ts Outdated
@12joan
Copy link
Copy Markdown
Owner

12joan commented Jul 7, 2023

Thanks! Are we ready to merge?

@nickchen120235
Copy link
Copy Markdown
Contributor Author

I think we are good to go!

@12joan 12joan merged commit 8280d5f into 12joan:main Jul 7, 2023
@nickchen120235 nickchen120235 deleted the add-credentials branch July 9, 2023 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add additional client credentials

2 participants