-
Notifications
You must be signed in to change notification settings - Fork 81
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
Architecture question #110
Comments
Also the question about extending providers list.
Of course in reality we will need to add providers to Container using May be the should be easier way to add providers? so that anyone could make their provider in different repo and it could easily be loaded. If providers will continue adding to list it will became not so maintainable or easy to read imo. May be we need provider interface so that it could instantiate filters, providers list, and internal object itself. So we could just pass additional providers to constructor. |
I'm sorry I didn't quite understand your first comment. Do you have a use case or a little piece of code to show me? About the providers list, I'm quite satisfied with the way they are initialized now. Do you think a provider interface would be easier to use? I think a simple bootstrap file can already be used quite simply and committed in a separate repo. |
About first comment.
so this will be the partial solution for opengraph/own tags. But raw author name available only in oembed data. located not as oembed spec suggests. So the question how could i get it. It seems that i couldn't use oembed provider because url building is tightly binded in it. |
Oh ok! I'm currently fiddling with a JS rewrite, with a different philosophy, and I am trying to resolve the same kind of issues. I think a kind of middleware implementation would work well, or a pattern with Request/Response objects, like a lot of frameworks. I'll continue working on this to see if it leads somewhere. |
About the js rewrite. iframe.ly have js sources, with many providers, so you could take at look at them. current api lacks normal http firmware layer. it use http client just as file_get_contents :) |
There is Oembed provider available in code. But some resources provide oembed data without normal acknowledgement.(Yes it is incorrect according oembed spec, but we live in real world, for example in 500px for url https://500px.com/photo/126454999/fox-by-helena-kuchynková we can find oembed at https://500px.com/photo/126454999/oembed.json ) So we could make url for oembed data. But current oembed provider class need endpoint. We can't set endpoint to url, because we has now acknowledge of it. We don't want it global.
The good solution will be to check returning headers, so that if we get json from server it is content to use, not to search for oembed endpoint. But current HTTP class doesn't provide any headers info, it just returns plain text.
The less painful solution to current architecture is to add some internal flas as (requesting url is endpoint) and then in specific resource provider set it, and preprocess url as needed. But here there will be other problem, because url can be not returned in requested json, it will be set as requested one, that will be incorrect one, cause lead not to source page, but to processed one.
Maybe the best solution will be just write my own provider class for such "incorrect oembeds", but it will almost fully be the same. May be i should add above flag and even requesting url to options page. but in providers setup i couldn't get requested url, to modify it.
For some resources we need to chain calling different providers, like oembed and metatags, and so it is again look pretty strange, don't know how will be more right way to use it.
So may be you could suggest what would be good according existent architecture.
The text was updated successfully, but these errors were encountered: