A simple Embedly package for Meteor.js. This lets you use the Extract and Embed APIs from Embedly to retrieve metadata and other good stuff from a URL. Disclaimer: this is my first Meteor package, so there are undoubtedly many better ways of doing things. Open to suggestions and would love help!
In order to use this, you'll need an Embedly API Key and set it in your Meteor.settings file.
Just run meteor add mswartz:embedly
here: http://embed.ly/api
Create a settings.json
file in your app with the following structure:
{
"public": {
"embedlyApiKey": "b4853d518e7847378a1fb018fba95878"
}
}
Or like this if you don't want to use Embedly from the client:
{
"embedlyApiKey": "b4853d518e7847378a1fb018fba95878"
}
Then run your app and initialize the settings with this command: meteor --settings settings.json
if that's what your json file is called and that's where it lives, in this example at the root.
Once the package is installed and you've entered your API key, you're ready to roll. Call the Extract function with Embedly.extract(url)
and call the Embed function with Embedly.embed(url)
. This will return JSON with all kinds of data about the link you pass it.
Docs are here:
I'll explore adding more parameter granularity to the calls, and maybe implement the Display API. Or if anyone wants to help add that stuff, that'd be great!
I wasn't sure how to write tests for this without baking in an API key. Suggestions?
To Jeff Vlahos (@jvlahos) for writing the original Embedly API calls that I swiped from his Courier project.