Use Twitter OG tags if no Twitter credentials are configured#522
Merged
pajlada merged 6 commits intoSep 9, 2023
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #522 +/- ##
==========================================
+ Coverage 46.90% 46.91% +0.01%
==========================================
Files 99 99
Lines 3710 3717 +7
==========================================
+ Hits 1740 1744 +4
- Misses 1920 1922 +2
- Partials 50 51 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Contributor
Contributor
|
Also if I'm not mistaken, #510 is also trying to solve the same underlying issue - The fact Twitter embeds don't work. I don't know if there has been a discussion whether we'd go that route or this route with OG tags. |
Contributor
Author
|
I would consider falling back to OG tags by default to be desirable despite the other PR, since the API used there is unofficial. |
I really don't like how this changes twitter/resolver.go, but I haven't managed to figure out a better way to check if a request matches.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull request checklist:
CHANGELOG.mdwas updated, if applicableDescription
Appends "(bot)" to User-Agent so that the default resolver can fetch OpenGraph tags for twitter links.
I don't like how this identifies twitter links, but it's the best I could come up with on the spot.
Note that the default resolver is only used if no Twitter token is specified in the config.
Closes #499