Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
angular-embed
Advanced tools
This library wraps the embed services from [NoEmbed](http://noembed.com/) and [Embed.ly](http://embed.ly/).
This library wraps the embed services from NoEmbed and Embed.ly.
NoEmbed is an open-source project which provides a lot of supported services.
Because it's free and unlimited, we use this service first.
But sometimes, when the page is unknown, NoEmbed can't provide anything.
Then when we try to retrieve information on a page that NoEmbed doesn't support, we use Embed.ly. It is a lot more accommodating with random page. It use an extractor to retrieve a title, a description and an illustration if available.
Embed.ly limits the amount of requests and requires an API key so you need to register.
angular-embed
and angular-embedly
in your page<script src="bower/angular-embedly/em-minified/angular-embedly.min.js"></script>
<script src="bower/angular-embed/dist/angular-embed.min.js"></script>
angular.module('myApp', [
// set `angular-embed` as a dependency of your module
'angular-embed'
// inject the service
]).controller('Ctrl', ['embedService', function(embedService) {
// retrieve page information
embedService.get('https://www.youtube.com/watch?v=Ksd-a9lIIDc')
}]).config(function(embedlyServiceProvider) {
// set your embed.ly key
embedlyServiceProvider.setKey('your key');
});
<ng-embed url="https://www.youtube.com/watch?v=Ksd-a9lIIDc"></ng-embed>
<div ng-embed="https://www.youtube.com/watch?v=Ksd-a9lIIDc"></div>
<div class="ng-embed:https://www.youtube.com/watch?v=Ksd-a9lIIDc;"></div>
angular-embed comes with some custom handlers
Name | Description |
---|---|
ngEmbedFacebookHandler | Add a width parameter to the facebook embed code and an App id (see below) |
ngEmbedInstagramHandler | Use embed.ly for instagram |
ngEmbedTwitterHandler | Construct a custom <blockquote> element from embed.ly's metadata |
ngEmbedYoutubeHandler | Use embed.ly for youtube |
To use a special handler, register them in the run
block.
angular.module('myApp')
.run(['embedService', 'ngEmbedTwitterHandler', 'ngEmbedFacebookHandler',
function(embedService, ngEmbedTwitterHandler, ngEmbedFacebookHandler) {
embedService.registerHandler(ngEmbedFacebookHandler);
embedService.setConfig('facebookAppId', 'xxxxxxxxxxxxxxx');
embedService.registerHandler(ngEmbedTwitterHandler);
// optional: if true, prevent to use noembed as first choice (default: false)
embedService.setConfig('useOnlyFallback', true);
}
]);
You can register all the handlers you want. An handler must match this structure and must return a promise of a valid oembed code.
{
name: 'Twitter',
patterns: [
'https?://(?:www|mobile\\.)?twitter\\.com/(?:#!/)?[^/]+/status(?:es)?/(\\d+)/?$',
'https?://t\\.co/[a-zA-Z0-9]+'
],
embed: function(url, max_width) {
var deferred = $q.defer();
...
return deferred.promise;
}
}
FAQs
This library wraps the embed services from [NoEmbed](http://noembed.com/) and [Embed.ly](http://embed.ly/).
We found that angular-embed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.