jupadin / MMM-Wallpaper

MagicMirror² module to display an image or photo from unsplash as wallpaper
MIT License
7 stars 2 forks source link

How do i generate collection ID's from Unsplash? #1

Closed monukoshy closed 2 years ago

monukoshy commented 2 years ago

Love this wallpaper module, especially the wallpapers on unsplash are one of the best ones on the internet. Thankfully there is a module for MM for this. However i am trying to figure out how to generate collection id for a certain type of wallpaper for eg:- Dark Backgrounds? https://unsplash.com/s/photos/dark-background

Can you please guide.

jupadin commented 2 years ago

Hi, I'm not quite sure whether you can generate a collectionID based on a certain type of wallpaper. However, I added a new parameter query, where you can type in your search keywords like Dark Background, such that the module only returns wallpaper, which are tagged with these keywords.

A second possibility would be - as far as I recall correctly - to create an account and create an own collection with the wallpaper you like and use this generated (own) collectionID.

monukoshy commented 2 years ago

Thanks for your reply. That will help. Also i think if you can add an option to pull the wallpapers from the favourites. Several people usually add the wallpaper into their favourites. if you can add a option we can just get all the wallpapers to show up from our favourites.

jupadin commented 2 years ago

This option is already implemented - just use the collection ID of your favorite collection(s) as comma separated list (e.g. ["1101429"]) It can be found in the URL of your desired collection. The URL should look like the following: https://unsplash.com/collections/<yourCollectionID>/<yourCollectionName>

monukoshy commented 2 years ago

Hello I tried that, and the collection id from the favourites do not work. However single wallpaper id works. I think there is an issue, can you please test it on your setup?

jupadin commented 2 years ago

Hi,

glad that at least single wallpaper id works for you. Of course is the collectionID from favorites tested - can you give me your user name or collectionID to test exactly your it on my setup ? For me the collectionID from a random collection as well as from my own collection works perfectly. Can you describe how you get the collectionID and what you did ?

monukoshy commented 2 years ago

Thanks. My Unsplash user is is @monukoshy Collection id is https://unsplash.com/collections/0mTpa26cG5w/textures/4014b532f62e0737afd008625c8423a0

jupadin commented 2 years ago

Hi, thanks for the information. Given your link, the collectionID is 0mTpa26cG5w. As stated above, your configuration should then look like this:

module: 'MMM-Wallpaper',
position: 'fullscreen_below',
config: {
        updateInterval: 0,
        unsplashAPIKey: "YOUR API-KEY", // REQUIRED
        query: false,
        collectionIDs: ["0mTpa26cG5w"],
        userName: false,
        photoID: false, 
        autoDim: true, 
        brightImageOpacity: 0.85, 
        imageOrientation: "landscape",
        imageWidth: "auto",
        imageHeight: "auto",
        imageOptions: "fit=fill&fill=blur",
}

or minified, due to default values:

module: 'MMM-Wallpaper',
position: 'fullscreen_below',
config: {
        unsplashAPIKey: "YOUR API-KEY", // REQUIRED
        collectionIDs: ["0mTpa26cG5w"],
}

Hope this solves your issue...

monukoshy commented 2 years ago

Hello thank you so so very much, yes its working now. Your wallpaper module is the real deal, its the best wallpaper module for non mirror setup.

jupadin commented 2 years ago

Oh, perfect! :-) Glad that I could help! So, I would close this issue then. Feel free to open another issue, if there is something still not working or if you want to have another feature.