Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions MMM-Instagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Module.register('MMM-Instagram', {
access_token: '',
count: 200,
min_timestamp: 0,
instaMaxWidth: '100%',
instaMaxHeight: '100%',
loadingText: 'Loading...'
},

Expand Down Expand Up @@ -77,12 +79,15 @@ Module.register('MMM-Instagram', {
var tempimage = this.images.photo[this.activeItem];

// image
var imageLink = document.createElement('div');
//imageLink.innerHTML = "<img src='https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'>";
imageLink.id = "MMM-Instagram-image";
imageLink.innerHTML = "<img src='" + tempimage.photolink + "'>";

var imageWrapper = document.createElement("img");
imageWrapper.src = tempimpage.photolink;
imageWrapper.id = "MMM-Instagram-image"
imageWrapper.style.maxWidth = this.config.instaMaxWidth;
imageWrapper.style.maxHeight = this.config.instaMaxHeight;
imageDisplay.appendChild(imageWrapper);

imageDisplay.appendChild(imageLink);
wrapper.appendChild(imageDisplay);

return wrapper;
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The entry in `config.js` can include the following options:
|`min_timestamp`|Set to 0 to pull images from when you created the account.<br><br>This value is **REQUIRED**|
|`animationSpeed`|How long the fade out and fade in of photos should take.<br><br>This value is **REQUIRED**|
|`updateInterval`|How long before refreshing image list.<br><br>This value is **REQUIRED**|
|`instaMaxWidth`|Specify maximum width of the retrieved images. Can be absolute (e.g. '200px') or relative (e.g. '50%').<br><br>This value is **OPTIONAL**|
|`instaMaxHeight`|Specify maximum height of the retrieved images. Can only be absolute (e.g. '100px').<br><br>This value is **OPTIONAL**|

Here is an example of an entry in `config.js`
```
Expand All @@ -39,7 +41,9 @@ Here is an example of an entry in `config.js`
count: 200,
min_timestamp: 0,
animationSpeed: 2500,
updateInterval: 12500
updateInterval: 12500,
instaMaxWidth: '20%', // Optional parameter, can be relative (percentage) or absolute (px)
instaMaxHeight: '200px' // Optional parameter, can be absolute only (px)
}
},
```
Expand Down