This package has been deprecated

Author message:

This package is deprecated in response to violation of Stocksnap.io ToS

stocksnap.io

0.1.4 • Public • Published

node-stocksnap.io

A make-shift api interpreter for stocksnap.io

Installation

  npm install stocksnap.io --save

Usage

Variables:

query:(string) Search term, can be null (will default to no search).  
options:(object) can contain:  
  * sort:(string) Choose which sorting page you're using, can be 'relevance' (when using a search query), 'date', 'trending', 'views', 'downloads' and 'favorites'.  
  * pages:(int) Amount of pages you want to rip.  
  * shuffle:(bool) If you want to shuffle the final array for a more random array of photos.  
  * highres:(bool) If you want the image links referencing to the downloadable high res images instead of the thumbnails.

fn:(function) Callback that gives an array with photos as a variable.  

Code

//Require the module
var stocksnap = require('stocksnap.io');
 
//options object
var options = {
  sort: 'views'
};
 
//Getting pictures of doors
stocksnap('doors', options, function (snaps) {
  console.log('Pictures of doors', snaps);
});
//Look at test.js for more examples

Tests

  npm test

Sidenote

When using the "highres" option in the api, you'll notice that you can't download the images going to the links or directly reference them in <img> tags.
This is because of the (genius) architecture of StockSnap.io. In order to download the higher res photo's you need to do a POST request to the links, instead of a GET.

Contributing

Do whatever, and give me a pull request. Sorry for the sloppy coding.

License

Check LICENSE for more information.

Package Sidebar

Install

npm i stocksnap.io

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • 96aa48