instagram-screen-scrape
Advanced tools
| { | ||
| "$schema": "http://json-schema.org/draft-04/schema#", | ||
| "type": "object", | ||
| "properties": { | ||
| "id": { | ||
| "type": "string" | ||
| }, | ||
| "username": { | ||
| "type": "string" | ||
| }, | ||
| "time": { | ||
| "type": "integer", | ||
| "description": "UNIX time at which the post was made" | ||
| }, | ||
| "type": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "image", | ||
| "video" | ||
| ] | ||
| }, | ||
| "like": { | ||
| "type": "integer", | ||
| "minimum": 0 | ||
| }, | ||
| "comment": { | ||
| "type": "integer", | ||
| "minimum": 0 | ||
| }, | ||
| "text": { | ||
| "type": "string" | ||
| }, | ||
| "image": { | ||
| "type": "string", | ||
| "format": "uri" | ||
| }, | ||
| "video": { | ||
| "type": "string", | ||
| "format": "uri" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "id", | ||
| "username", | ||
| "time", | ||
| "type", | ||
| "like", | ||
| "comment", | ||
| "text" | ||
| ] | ||
| } |
+36
| // Generated by CoffeeScript 1.9.3 | ||
| (function() { | ||
| var JSONStream, jsonRequest, request, zlib; | ||
| request = require('request'); | ||
| JSONStream = require('JSONStream'); | ||
| zlib = require('zlib'); | ||
| jsonRequest = function(jsonSelector, options) { | ||
| var outStream; | ||
| outStream = JSONStream.parse(jsonSelector); | ||
| options.gzip = true; | ||
| request(options).on('response', function(response) { | ||
| var encoding, gunzip, ref; | ||
| if (response.statusCode === 200) { | ||
| encoding = (ref = response.headers['content-encoding']) != null ? ref.trim().toLowerCase() : void 0; | ||
| if (encoding === 'gzip') { | ||
| gunzip = zlib.createGunzip(); | ||
| return response.pipe(gunzip).pipe(outStream); | ||
| } else { | ||
| return response.pipe(outStream); | ||
| } | ||
| } else { | ||
| throw new Error("Instagram returned status code: " + response.statusCode); | ||
| } | ||
| }); | ||
| return outStream; | ||
| }; | ||
| module.exports = { | ||
| jsonRequest: jsonRequest | ||
| }; | ||
| }).call(this); |
+3
-14
| // Generated by CoffeeScript 1.9.3 | ||
| (function() { | ||
| var InstagramPosts, JSONStream, Readable, getPosts, request, | ||
| var InstagramPosts, Readable, getPosts, jsonRequest, | ||
| bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
@@ -10,7 +10,5 @@ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
| request = require('request'); | ||
| jsonRequest = require('./util').jsonRequest; | ||
| JSONStream = require('JSONStream'); | ||
| /** | ||
@@ -26,5 +24,3 @@ * Make a request for a Instagram page, parse the response, and get all the | ||
| getPosts = function(username, startingId) { | ||
| var outStream; | ||
| outStream = JSONStream.parse('items.*'); | ||
| request.get({ | ||
| return jsonRequest('items.*', { | ||
| uri: "https://instagram.com/" + username + "/media/", | ||
@@ -34,10 +30,3 @@ qs: { | ||
| } | ||
| }).on('response', function(resp) { | ||
| if (resp.statusCode === 200) { | ||
| return resp.pipe(outStream); | ||
| } else { | ||
| throw new Error("Instagram returned status code: " + resp.statusCode + " for user '" + username + "' and startingId: '" + startingId + "'"); | ||
| } | ||
| }); | ||
| return outStream; | ||
| }; | ||
@@ -44,0 +33,0 @@ |
+2
-1
| { | ||
| "name": "instagram-screen-scrape", | ||
| "description": "scrape public instagram data w/out API access", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "author": "Sean Lang <slang800@gmail.com>", | ||
@@ -21,2 +21,3 @@ "bin": { | ||
| "isstream": "^0.1.2", | ||
| "json-schema": "^0.2.2", | ||
| "mocha": "^2.2.4", | ||
@@ -23,0 +24,0 @@ "should": "^5.2.0" |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47314
3.25%9
28.57%230
45.57%0
-100%5
25%