It is currently April 19th, 2024, 4:09 am

Senja Suite Slideshow Imgur Feed Code

Get help with creating, editing & fixing problems with skins
Chertoff
Posts: 2
Joined: May 6th, 2018, 12:13 pm

Senja Suite Slideshow Imgur Feed Code

Post by Chertoff »

Hello guys.

I'm using Senja Suite and there is a skin under which it has a slideshow which shows images based on a folder location.

All I want is that instead of a folder location, the images should be parsed off an Imgur feed online.
Also I want the images to be resized to fit the slideshow.

Here is the code:

Code: Select all

[Rainmeter]
Author=aidendrew.deviantart.com - http://rainmeterdesk.blogspot.com
Update=30000

;----------------------------------------------------------------

[Viewer]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=C:\Users\Administrator\Documents\Rainmeter\Skins\Senja\@Resources\Images\
Subfolders=1
FileFilter=*.jpg;*.jpeg;*.jpe;*.bmp;*.gif;*.png


[bg]
Meter=Image
ImageName=bg.png
X=2
Y=60

[Image]
MeasureName=Viewer
Meter=IMAGE
X=5
Y=95
W=215
H=340

[Logo]
Meter=Image
ImageName=logo.png
X=80
Y=60

[Bar]
Meter=Bar
x=5
y=415
W=215
H=32
SolidColor=e62b3e
BarOrientation=Horizontal


[Left]
Meter=Image
ImageName=left.png
X=42
Y=419
LeftMouseUpAction=!Execute [!RainmeterRefresh]


[Right]
Meter=Image
ImageName=Right.png
X=162
Y=r
LeftMouseUpAction=!Execute [!RainmeterRefresh]

[View]
Meter=ROUNDLINE
x=175
Y=73
W=18
H=18
LineLength=6
LineColor=6a6c6c
AntiAlias=1
Solid=1
DynamicVariables=1
LeftMouseUpAction=!Execute ["[Viewer]"]

[Close]
Meter=ROUNDLINE
x=195
Y=r
W=18
H=18
LineLength=6
LineColor=6a6c6c
AntiAlias=1
Solid=1
DynamicVariables=1
LeftMouseUpAction=!DeactivateConfig



--------------------------------------------------------------------
Help would be much appreciated!
Last edited by Chertoff on May 7th, 2018, 2:57 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Senja Suite Slideshow Imgur Feed Code

Post by jsmorley »

This will be moderately challenging. First and foremost, we need to know a link to an imgur feed that you have in mind. The first thing we must be sure of is that the link is to an open feed, that doesn't require that you be logged -in to view. WebParser can't log you into anything, so that would be a show-stopper.

The next challenge is to get a "random" entry from that feed. That is just not going to be practical in native Rainmeter in my view, and I think you are going to be out into Lua to do this.

What I think one would do, is to get the entire feed, and use Lua to parse that feed into a table (array) of feed entries. Then generate a random number, and choose one of the entries from the table based on the random "index" into the table array.

It would need to remove the table entries as it uses them, so you get a true "random" in the sense of drawing a card and discarding it, not in the sense of rolling dice, where repeats are absolutely possible.

If you want to tackle it, we are glad to help. but we need that link first and foremost.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Senja Suite Slideshow Imgur Feed Code

Post by eclectic-tech »

I addition to JSMorley's advice:

Imgur.com's API uses OAuth 2.0 to limit access via applications; this means you need to create an account, and sign in to it, in order to request images. The Webparser measure in Rainmeter can not parse any images without the authorization key.

If you want to use Imgur as the source, you need to follow the steps here, then when requesting assistance on the code, use a "fake authorization key" in your examples; sharing your real key (unless you pay for a commercial API account) is not advised.
Chertoff
Posts: 2
Joined: May 6th, 2018, 12:13 pm

Re: Senja Suite Slideshow Imgur Feed Code

Post by Chertoff »

Uhm okay, I'm quite new to Rainmeter and hence its a bit difficult for me to cope up with the existing setup or webparser.

I think for now I'll learn other aspects of Rainmeter prior to learning this. This can be locked, thank you!