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

As an oembed provider, how do I provide a javascript rich html? #19

Closed
simkimsia opened this issue Mar 27, 2013 · 3 comments
Closed

As an oembed provider, how do I provide a javascript rich html? #19

simkimsia opened this issue Mar 27, 2013 · 3 comments

Comments

@simkimsia
Copy link

Hi there, I have no issues creating API end point.

My issue is how do I provide a javascript rich html material?

The html material I want to provide is a "book" and the javascript library I will rely on is turnjs.

Here is an example of the page I want to expose via noembed:
http://www.turnjs.com/#samples/steve-jobs

So how do I prepare the resource for the resource to be embeddable?

@leedo
Copy link
Owner

leedo commented Mar 27, 2013

Hi there,

If you are implementing this all on the noembed side of things (aka not running an external oEmbed service) you'll probably want to create an HTML template in share/templates/. Then you can use $self->render($vars) in the serialize method. Then you can include any javascript you want in your template.

Here is an example:
render call: https://github.com/leedo/noembed/blob/master/lib/Noembed/Source/Twitter.pm#L82
template: https://github.com/leedo/noembed/blob/master/share/templates/Twitter.html

I hope that helps!

@simkimsia
Copy link
Author

Hi leedo,

I am using PHP for my web application.

So does that mean I need to git clone the noembed files and then host them on my server?

I believe noembed uses Perl?

@leedo
Copy link
Owner

leedo commented Mar 28, 2013

Hi again,

If this is your own application, I would suggest just implementing an oEmbed endpoint in your own application. Then adding noemebd support is as simple as something like the Flickr provider.

See here for more details: http://oembed.com/#section1

You would want to implement the rich type, making sure the html parameter is defined.

@leedo leedo closed this as completed Apr 11, 2013
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

No branches or pull requests

2 participants