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

Load Tweets using embed endpoint if no API key is present #510

Closed
wants to merge 2 commits into from

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Aug 1, 2023

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

If no Twitter API key is configured, the twitter resolver uses the embed endpoint (used by vercel/react-tweet as well). The only downside is that retweets aren't displayed.

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #510 (7d64ecc) into master (88b86e1) will increase coverage by 1.29%.
The diff coverage is 75.59%.

@@            Coverage Diff             @@
##           master     #510      +/-   ##
==========================================
+ Coverage   46.90%   48.19%   +1.29%     
==========================================
  Files          99      100       +1     
  Lines        3710     3872     +162     
==========================================
+ Hits         1740     1866     +126     
- Misses       1920     1954      +34     
- Partials       50       52       +2     
Files Changed Coverage Δ
internal/resolvers/twitter/tweet_loader.go 36.89% <0.00%> (-0.37%) ⬇️
internal/resolvers/twitter/embed_loader.go 68.22% <68.22%> (ø)
internal/resolvers/twitter/initialize.go 100.00% <100.00%> (ø)
internal/resolvers/twitter/resolver.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@KararTY
Copy link
Contributor

KararTY commented Aug 1, 2023

Just some info: Went on for a bit trying to find info about the endpoint, vercel/react-tweet#76

Seems like it's an internal API used by Twitter's external iframe/HTML embeds.

@pajlada
Copy link
Member

pajlada commented Sep 9, 2023

I prefer the solution from #522 right now - the embed solution doesn't seem to work which tells me it's going to be a bit flaky. If there's a library we can use that keeps this up-to-date I'm open to using this approach

@Nerixyz Nerixyz closed this Sep 9, 2023
@Nerixyz Nerixyz deleted the feat/tweets branch September 9, 2023 17:20
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.

3 participants