~romuloalves/get-instagram-feed

34cf02e880e0a67d54efd4eb406d4651f315622c — Rômulo Alves 4 years ago f391b99
Fixing the manipulation of data when no profile is found. Bug #2
4 files changed, 9 insertions(+), 5 deletions(-)

M .gitignore
M package.json
M src/get-picture.js
M src/index.js
M .gitignore => .gitignore +1 -0
@@ 1,2 1,3 @@
node_modules
.DS_Store
npm-debug.log

M package.json => package.json +2 -3
@@ 1,14 1,13 @@
{
  "name": "get-instagram-picture",
  "version": "0.1.0",
  "version": "0.1.1",
  "main": "src/index.js",
  "scripts": {
    "start": "micro"
  },
  "dependencies": {
    "micro": "latest",
    "micro-get": "^0.1.1",
    "now-logs": "^0.0.7"
    "micro-get": "^0.1.1"
  },
  "license": "MIT"
}

M src/get-picture.js => src/get-picture.js +6 -1
@@ 13,7 13,12 @@ const getJsonData = html => {
}

const getImages = data => {
  return data.entry_data.ProfilePage[0].user.media.nodes.map(media => {
  if (data == null || data.entry_data == null ||
    data.entry_data.ProfilePage == null || data.entry_data.ProfilePage.length === 0) {
    return []
  }
  const [profilePage, ...other] = data.entry_data.ProfilePage
  return profilePage.user.media.nodes.map(media => {
    return {
      isVideo: media.is_video,
      dimensions: media.dimensions,

M src/index.js => src/index.js +0 -1
@@ 1,5 1,4 @@
// Packages
require('now-logs')('get-instagram-pics')
const {send} = require('micro')
const get = require('micro-get')