masongram icon indicating copy to clipboard operation
masongram copied to clipboard

Error with some data, null

Open eliaspizarro opened this issue 6 years ago • 4 comments

The plugin doesn't get all data from some photos, just copy your site and use my token if json (var e) doesnt contain caption data, the script doesnt creates the container with caption

https://mladenplavsic.github.io/masongram/

	  var client_id = '839264e956eb4d39bc82f011a8c05ad3';
	  var access_token = '1266759581.839264e.698e9150bb5245df8efe2d6a5359c0b6';
...
                create: function() {
                    n = o("<div>").attr({
                        tabindex: 0,
                        class: "masongram-image-container masongram-image-size-" + a.size
                    });
                    var t = o("<img>").attr({
                        src: e.images[a.size].url,
                        width: e.images[a.size].width,
                        height: e.images[a.size].height,
                        class: "masongram-image"
                    });
                    t.appendTo(n);
                    var i = o("<div>", {
                            class: "masongram-image-caption-container"
                        }),
                        c = o("<div>", {
                            class: "masongram-image-caption"
                        });
					console.log(e.caption);
                    e.caption && e.caption.text && c.html(this.parseCaption()), c.appendTo(i), i.appendTo(n)
                }
...

image

{id: "1682147778606925997_1266759581", user: {…}, images: {…}, created_time: "1514747663", caption: null, …}
attribution:null
caption:null
comments:{count: 1}
created_time:"1514747663"
filter:"Juno"
id:"1682147778606925997_1266759581"
images:{thumbnail: {…}, low_resolution: {…}, standard_resolution: {…}}
likes:{count: 4}
link:"https://www.instagram.com/p/BdYMH4DlAit/"
location:{latitude: -23.55, longitude: -70.4, name: "La Chimba, Antofagasta, Chile", id: 340784622}
tags:[]
type:"image"
user:{id: "1266759581", full_name: "Elias Pizarro", profile_picture: "https://scontent.cdninstagram.com/vp/e9e31bdf52831…2885-19/11311598_1475385782761823_629994861_a.jpg", username: "eliaspizarrorodriguez"}
user_has_liked:false
users_in_photo:[]
__proto__:Object

image

eliaspizarro avatar Mar 08 '18 11:03 eliaspizarro

Solved:

if (e.caption !== null) {
	e.caption && e.caption.text && c.html(this.parseCaption()), c.appendTo(i), i.appendTo(n);
} else {
	c.html(this.parseCaption()), c.appendTo(i), i.appendTo(n);
}

eliaspizarro avatar Mar 09 '18 03:03 eliaspizarro

Please make changes in src/ folder and use gulp to create dist files. If you have a solution to a problem, please create a pull request. Thanks!

mladenplavsic avatar Mar 10 '18 10:03 mladenplavsic

eliaspizarro which file u add this code?

shkupjane avatar Mar 20 '18 13:03 shkupjane

i can get only 20 photos with ur masongram why? @mladenplavsic can u help me pls i want to get all images from instagram

shkupjane avatar Mar 20 '18 13:03 shkupjane