Socket
Book a DemoInstallSign in
Socket

jsonp-flickr

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonp-flickr

Access Flickr's API via Jsonp from your browser

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Jsonp-flickr

Access Flickr's API from the browser via JSONP.

Installation:

npm install jsonp-flickr

You can use something like browserify to package for the browser.

Usage:

After you've initialized jsonp-flickr you can do as many requests you want as quickly as you want, jsonp will ensure that the right callback will get the right data and do all the clean up for you!

var flickr = require("jsonp-flickr");

var request = {
	method: "flickr.test.echo",
	format: "json",
	api_key: "a1faa53df9402fc5cc2d9746118f9ddc"
};

// Using the callback API
flickr.get(request, /* callback */ function (err, data) {
	this.innerHTML = JSON.stringify(data);
}, /* scope */ document.querySelector(".example1"));

// Using the promise API (vow promise)
var promise = flickr.get(request);

promise.then(function onSuccess(data) {
	document.querySelector(".example2").innerHTML = JSON.stringify(data);
}, function onError(err) {
	// on error
});

Licence

MIT

Keywords

jsonp

FAQs

Package last updated on 12 Jul 2014

Did you know?

Socket

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.

Install

Related posts