urigo / angular-embedly Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
According to [http://embed.ly/docs/api/embed/endpoints/1/oembed#the-rich-type](the docs) rich
media type is very similar to the video
type.
I would like to add the possibility of embedding the rich
media type.
embedlyService.extract(url)
returns this error
Error Object {data: "Cannot GET /function%20getProtocol()%20%7B%20%20%2…he-shopping-cart-patent-and-saved-online-retail/↵", status: 404, headers: function, config: Object, statusText: "Not Found"}config: Objectdata: "Cannot GET /function%20getProtocol()%20%7B%20%20%20%20%20%20%20%20%20%20%20%20return%20secure%20?%20%27https%27%20:%20%27https%27%20;%20%20%20%20%20%20%20%20}://api.embed.ly/1/extract?key=8d5fa3afe41a41d392b52af11adafbac&url=http://arstechnica.com/tech-policy/2013/01/how-newegg-crushed-the-shopping-cart-patent-and-saved-online-retail/↵"headers: function (name) {status: 404statusText: "Not Found"__proto__: Object
The angular-mocks
package is only used for testing. Hence it should be in the devDevependencies
instead of dependencies
. Now it's increasing the size of your vendor.js
file.
Hey @Urigo,
When constructing the embedly post you're using encodeURI() but really you should be using encodeURIComponent() as you are putting the encoded string as a query param.
This results in some urls failing to embed e.g. below:
https://www.google.com/maps/@45.5067683,-122.6069459,11z
Cheers
Sebastian
Embed.ly's API returns an HTML element containing an iframe
, which has the source set to //cdn.embedly.com/widgets/media.html
. This works fine if you're using angular-embedly over HTTP(S), but not if you're using it on file://
.
This is the case when you're e.g. using Cordova to build a mobile app.
I propose to add a line that checks for window.location.protocol == 'file:'
and if so prepends http:
to the iframe
source.
I am new to AngularJs development, and it really helps when there's a more detailed documentation (e.g.: explaining how to use the service to extract information).
Some great
I use Brunch (brunch.io)[brunch.io] for building. It requires the .bower.json
to have a main property, like this:
error: [Error: Component JSON file "/home/tom/project/bower_components/angular-embedly/.bower.json" must have main
property. See https://github.com/paulmillr/read-components#README]
It can be easily fixed by adding "main": "angular-embedly.js"
to the bower.json
file.
Assuming oEmbed is a verb, I can never know if the URL to be oEmbedded is actually oEmbedded.
For example retrieving this URL (verify on Embed.ly) doesn't throw an error, but also doesn't return an embed code. The user of the page then doesn't see anything.
We could find this out by looking at the result of the oEmbed call and see that it doesn't contain a HTML entry:
description: "Nancy Duarte, CEO of Duarte, Inc., outlines best practices for preparing your next speech."
provider_name: "Hbr"
provider_url: "http://hbr.org"
thumbnail_height: 720
thumbnail_url: "http://brightcove.vo.llnwd.net/e1/pd/2071817190001/2071817190001_2228601438001_stillImage-1-49cu0ygy-2235560989001.jpg?pubId=2071817190001"
thumbnail_width: 1280
title: "Connect with Any Audience"
type: "link"
url: "http://hbr.org/video/2228473586001/connect-with-any-audience"
version: "1.0"
My suggestion would be to add an attribute to the directive that passes a function to be called in this situation. That might look something like this:
<em-embed urlsearch="{{url}}" onerror="saySorryToUser()"></em-embed>
So, I can build it, with proper commit messages and all. If you have any comments let me know!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.