-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: parser refactor and updates #505
base: feat/the-grid
Are you sure you want to change the base?
Conversation
…ersalprofile.cloud into twitter-parser-updates
Task linked: DEV-11851 X (Twitter): allow different type of input |
Deployed with Cloudflare Pages ☁️ 🚀 🆗 |
…file.cloud into twitter-parser-updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this for now so we have oembed in use. Ideally we should break down parsers into individual platform files for easier customization.
Seem like it doesn't work for just a profile name: due to cors policy kick in, Non browser request works fine: I wonder if we could proxy this through our API, thoughts @richtera ? Also, for X we can skip oembed as it's straight forward to parse their embed. Should we just use oembed when we really need? |
Task linked: DEV-11989 Prevent SoundCloud autoplay |
matches = Array.from(input.matchAll(regex)) | ||
} else { | ||
const match = input.match(regex) | ||
console.log(JSON.stringify(match)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use console.log
, we have own logging mechanism:
if (gridLog.enabled) {
gridLog(JSON.stringify(match))
}
…file.cloud into twitter-parser-updates
…file.cloud into twitter-parser-updates
regexWithCallbacks: [ | ||
// Match whole embed code | ||
{ | ||
regex: createIframeRegex('https:\\/\\/warpcast\\.com\\/(?<id>[\\w.-]+)'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally it should be ```console
- 16 characters or fewer
- Latin alphabet, numbers or dash (
-
) - Cannot start with a dash
- Must end in (
.eth
), i.e. ENS-compatible names like[cb.id](http://cb.id/)
aren’t supported at this time - Not supported at this time:
- subdomains, e.g.
abc.test.eth
- DNS to ENS
- subdomains, e.g.
So maybe something like `\\/(?<id>[a-z0-9][a-z0-9-.]{0,15}$)`. They don't actually support unicode or other chars. Only a-z0-9 and - it seems. Although the "." in the name is not in the offficial docs although they say that ENS names work and they obviously require a dot. I suppose invalid names would just end up with an error page and should not be that bad.
Ticket ID
DEV-11851
DEV-11989
Description
Enhancements for other platforms will come in follow up prs