new! armstrong.apps.embeds

12 views
Skip to first unread message

Jon Cotton

unread,
Apr 7, 2014, 8:33:57 PM4/7/14
to armstr...@googlegroups.com

Announcing a totally new addition to the Armstrong family—armstrong.apps.embeds!
https://github.com/armstrong/armstrong.apps.embeds

AppsEmbeds is *the* way to use external media in your site and offers features you'll never get from copy-pasting an embed code iframe. Here's the premise: you use the right tool for the job. You use Youtube because hosting your own video isn't great. Someone else posted a video you want to reuse. You link to tweets because the conversation is happening on Twitter. Content like this exists at a canonical location full of rich metadata. You don't and shouldn't duplicate it just to use it in your site and so you link to it. That has weaknesses. Without text searching your database, how many links to a video do you have? Who authored that video? What about all that other metadata you can't get at because all you have is an iframe snippet that only loads itself on page render? You can't even control how the thing looks when embeded in your own site.

AppsEmbeds brings the benefits of relational data, caching, and API-based metadata capture for programatic access to external content. All you need is a single content link. More flexibily is offered with programmable backends that determine the actual API used to collect the external content. Regex link matching provides automatic assignment of the most appropriate backend, which you can change on assignment or anytime after from the Django Admin.

Now that you have full control of the external content's data and metadata, you can render it however you like. AppsEmbeds doesn't depend on any other Armstrong component though it plays very nicely with ArmLayouts for flexible templating. It's this flexible rendering that I think makes AppsEmbeds really awesome. Now an article can use a single embed—say a YouTube video—as lead art. On the topic page listing all the recent articles, this article shows up rendering a small version of the video thumbnail image. Click through and the article page shows a large version of the thumbnail now captioned with the video title and author—metadata plucked from YouTube. The thumbnail has your custom CSS with a play button overlay. Click that and the video starts playing, or maybe it opens in a modal window and starts playing.

How would you have used a YouTube video as lead art before? Could you have? Or was your YouTube only ever embedded copy-paste style in the body text of your articles? (Did you then take a screenshot of the video, create a new image record in the database, and relate lead art that way? shudder...this is the better way.)

AppsEmbeds was drafted over a year ago and in use at The Center for Investigative Reporting. Finally, this is the official Armstrong version ironed out with more features, documentation and fully tested. It's a 0.8 release just to give it a production run. I expect 1.0 to release without code changes. Actually, I'll probably do a 0.9 release for Django 1.7 support once django-extensions updates its Django support and I can run tests without it crying.

AppsEmbeds replaces the anemic, first-pass video support in armstrong.core.arm_content. The old code here[1] and here[2] will be deprecated and removed. If you are using it, I'm happy to talk. I guarantee you'll love this more. For one thing, it handles more than YouTube and Vimeo. How much more? Any of the 250+ providers that Embed.ly[3] can handle...like Storify, Hulu, Flickr, Picasa, instagram, Facebook, Kickstarter, Tumblr, Medium, SoundCloud, Blip.tv, TED, uStream, etc.

Wait...I thought the `armstrong.apps` packages were just reference/example implementations? Nope. AppsEmbeds is fully baked and ready to use *anywhere*. Even, and maybe especially, in non-Armstrong sites.

Let me know how you like this!

-Jon Cotton


[1]: https://github.com/armstrong/armstrong.core.arm_content/tree/v1.3.5/armstrong/core/arm_content/video
[2]: https://github.com/armstrong/armstrong.core.arm_content/blob/v1.3.5/armstrong/core/arm_content/fields/video.py
[3]: http://embed.ly/

Reply all
Reply to author
Forward
0 new messages