worldcompany / djangoembed

rich media consuming and providing with django
http://djangoembed.readthedocs.org
MIT License
138 stars 38 forks source link

embedly requires API key #25

Open jaap3 opened 12 years ago

jaap3 commented 12 years ago

Using embed.ly as an endpoint is really cool, but requires an api key. It will work, but after a while the response will be a 403:

 403: Forbidden - Embedly has blocked your client ip. Sign up for an API key at http://embed.ly.

However, I don't see a way to supply an API key using djangoembed

coleifer commented 12 years ago

Hmm...yeah, this definitely needs to be addressed. Looking into the best way to implement this. I'm somewhat kicking myself for writing the providers as database objects, would be nicer to have more programmatic control of them.

jaap3 commented 12 years ago

This commit 813a34eacd05c3550c38b7e3341de383708185ac makes it easier to include the key in the (activated) embedly providers.

I've been able to work around the issue in my case by passing a key= kwarg to request_resource, but that's only feasible if you use djangoembed programmaticaly. I'm assuming most people just use the templatetags.

coleifer commented 12 years ago

Yeah, totally -- it's not a problem if you're doing by hand, but if you want it to "just work" with the tags it gets a little tricky -- the internal API of the app probably needs to be refactored. One option is to add arbitrary url parameters to a stored provider and just use those on every request, but it seems kinda gross.

okke-formsma commented 12 years ago

Why not look for a embed.ly key in the settings.py file?

coleifer commented 12 years ago

yeah but you don't want to send your api key to youtube -- need to be able to specify "these" credentials -> "these" oembed providers

coleifer commented 12 years ago

You may want to check out my new project: http://micawber.readthedocs.org/ it should be able to better handle embed.ly

inactivist commented 12 years ago

OK, so how do I provide my embed.ly key when using djangoembed? I don't see this documented anywhere. Edit: Clarify question...

coleifer commented 12 years ago

I assume you're using django:

http://micawber.readthedocs.org/en/latest/django.html#additional-settings

http://micawber.readthedocs.org/en/latest/api.html#micawber.providers.bootstrap_embedly https://github.com/coleifer/micawber/blob/master/micawber/contrib/mcdjango/providers.py#L10

inactivist commented 12 years ago

@coleifer: Thanks for that; yes, using Django. I haven't yet decided to use micawber (but may soon if I can't resolve this issue to my satisfaction)