Hi! I'll try to be specific.
I want my skin to show a rss feed from google news, then 10 seconds later, show another rss feed from google news, and so...
At least 10 diferent news articles, without title (Google News).
The attached image shows what i mean.
It is currently September 16th, 2024, 7:54 pm
Automatically switch rss reader
-
- Posts: 31
- Joined: January 27th, 2021, 8:05 pm
Automatically switch rss reader
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Automatically switch rss reader
First of all, besides simpler samples that can be used as a direction to pursue, we don't do skin requests on this forum, the only thing we can and will do is help YOU write your own skin.
Secondly, what you want is not exactly trivial. A tutorial on getting RSS / Atom feeds already exists in the manual, and can be adapted to work with your source of feeds, if by any chance you don't retrieve them yet (make sure that you actually try to understand how to do it, instead of just copy pasting stuff, as some of the ideas there might help you in other places in your code):
https://docs.rainmeter.net/tips/rss-feed-tutorial/
There are also simpler skins already querying for Google News RSS feeds here on the forum or on DeviantArt, which you could use as an inspiration, if you don't have that part done (which is not 100% clear from your screenshots).
Thirdly, once you have either a sufficient number of retrieved RSS "items" or, if ambitious, all of them - albeit that might need you to first capture the entire "item" with StringIndex and then extract the desired tags from the its measure with StringIndex2, since the number of captures you can retrieve with either is limited to 99 as per the manual - ,:
https://docs.rainmeter.net/tips/webparser-using-stringindex2/
we can think about switching from one item to the next every 10 seconds, as that's just a matter of using a bang like !SetVariable:
https://docs.rainmeter.net/manual/bangs/#SetVariable
to increment (in the OnUpdateAction of some measure updated every 10 seconds via UpdateDivider) some ItemIndex variable storing the current item index, and using it like MeasureName=Item#ItemIndex#Title in the relevant meter (I know you don't want the title, I just used it as an example here). Obviously, the !SetVariable should be followed by properly updating all meters and redrawing the skin (like [!UpdateMeter *][!Redraw]), and the meters should have DynamicVariables=1 added to them, so that the changes are reflected visually.
So yeah, it's a bit of work and reading a few things from the manual in order to achieve your objective, and might seem confusing if you've never done it before, but it's possible and you get the idea it will become clearer and make more sense.
-
- Posts: 31
- Joined: January 27th, 2021, 8:05 pm
Re: Automatically switch rss reader
Yeah, for me is really complicated, i have never done it before.
Where do i make skin requests ??
Where do i make skin requests ??
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Automatically switch rss reader
Well, there is always a first time for everything, if you really want it. All of us started as beginners at one time, and encountered the same difficulties as you do now, with stuff seeming more complicated than it really was. As they say, no pain, no gain - can't expect someone else to do the job for you if yourself are not willing to give it a try.
You don't, at least not on this forum - see here.
-
- Posts: 31
- Joined: January 27th, 2021, 8:05 pm
Re: Automatically switch rss reader
The Google RSS feed does not work with the example given in the Rainmeter tutorial.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
Item=(?(?=.*<entry>).*<entry>.*<updated>(.*)</updated>.*<link.*"(.*)".*<title.*>(.*)</title>)
Sub="^\s+":"","<!\[CDATA\[":"","\]\]>":"","!\[CDATA\[":"","\]\]":""
[MeasureSite]
Measure=WebParser
URL=https://news.google.com/?hl=en-US&gl=US&ceid=US:en
RegExp=(?siU)<title>(.*)</title>.*<link.*"(.*)".*<updated>(.*)</updated>#Item##Item##Item##Item##Item#
;Site info
[MeasureSiteTitle]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureSiteLink]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2
[MeasureSiteDate]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3
;Item 1 info
[MeasureItem1Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem1Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5
[MeasureItem1Date]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6
;Item 2 info
[MeasureItem2Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem2Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=8
[MeasureItem2Date]
Measure=WebParser
URL=[MeasureSite]
StringIndex=9
;Item 3 info
[MeasureItem3Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=10
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem3Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=11
[MeasureItem3Date]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12
;Item 4 info
[MeasureItem4Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=13
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem4Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=14
[MeasureItem4Date]
Measure=WebParser
URL=[MeasureSite]
StringIndex=15
;Item 5 info
[MeasureItem5Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=16
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem5Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=17
[MeasureItem5Date]
Measure=WebParser
URL=[MeasureSite]
StringIndex=18
;MeterStyles
[TextStyle]
X=5
Y=3R
W=290
H=40
FontFace=Segoe UI
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
ClipString=1
AntiAlias=1
ToolTipWidth=300
;Meters
[MeterBackground]
Meter=Image
W=300
H=255
SolidColor=50,50,50,255
[MeterSite]
Meter=String
MeasureName=MeasureSiteTitle
MeterStyle=TextStyle
H=20
Y=5
FontColor=196,245,184,255
StringStyle=Bold
LeftMouseUpAction=["[MeasureSiteLink]"]
ToolTipText=%1#CRLF#[MeasureSiteDate]
DynamicVariables=1
[MeterItem1]
Meter=String
MeasureName=MeasureItem1Title
MeterStyle=TextStyle
Y=10R
LeftMouseUpAction=["[MeasureItem1Link]"]
ToolTipText=%1#CRLF#[MeasureItem1Date]
DynamicVariables=1
[MeterItem2]
Meter=String
MeasureName=MeasureItem2Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem2Link]"]
ToolTipText=%1#CRLF#[MeasureItem2Date]
DynamicVariables=1
[MeterItem3]
Meter=String
MeasureName=MeasureItem3Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem3Link]"]
ToolTipText=%1#CRLF#[MeasureItem3Date]
DynamicVariables=1
[MeterItem4]
Meter=String
MeasureName=MeasureItem4Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem4Link]"]
ToolTipText=%1#CRLF#[MeasureItem4Date]
DynamicVariables=1
[MeterItem5]
Meter=String
MeasureName=MeasureItem5Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem5Link]"]
ToolTipText=%1#CRLF#[MeasureItem5Date]
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 5519
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Automatically switch rss reader
EDIT: Where did you get that code? It is NOT in any of the tutorials I found in the manual...
As for the posted code, "Yes", it does not work because Google changed their news site...
Here is an updated version that will work as an example:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
Item=(?(?=.*<item>).*<item>.*<title>(.*)</title>.*<link>(.*)</link>)
Sub="^\s+":"","<!\[CDATA\[":"","\]\]>":"","!\[CDATA\[":"","\]\]":""
[MeasureSite]
Measure=WebParser
URL=https://news.google.com/news/feeds?output=rss
RegExp=(?siU)<title>(.*)</title>.*<link>(.*)</link>#Item##Item##Item##Item##Item#
;Site info
[MeasureSiteTitle]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureSiteLink]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2
;Item 1 info
[MeasureItem1Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem1Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4
;Item 2 info
[MeasureItem2Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem2Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6
;Item 3 info
[MeasureItem3Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem3Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=8
;Item 4 info
[MeasureItem4Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=9
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem4Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=10
;Item 5 info
[MeasureItem5Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=11
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem5Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12
;MeterStyles
[TextStyle]
X=5
Y=4R
W=290
H=40
FontFace=Segoe UI
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
ClipString=1
AntiAlias=1
ToolTipWidth=300
;Meters
[MeterBackground]
Meter=Image
W=300
H=265
SolidColor=50,50,50,255
[MeterSite]
Meter=String
MeasureName=MeasureSiteTitle
MeterStyle=TextStyle
H=20
Y=5
FontColor=196,245,184,255
StringStyle=Bold
LeftMouseUpAction=["[MeasureSiteLink]"]
ToolTipText=%1
DynamicVariables=1
[MeterItem1]
Meter=String
MeasureName=MeasureItem1Title
MeterStyle=TextStyle
Y=10R
LeftMouseUpAction=["[MeasureItem1Link]"]
ToolTipText=%1
DynamicVariables=1
[MeterItem2]
Meter=String
MeasureName=MeasureItem2Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem2Link]"]
ToolTipText=%1
DynamicVariables=1
[MeterItem3]
Meter=String
MeasureName=MeasureItem3Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem3Link]"]
ToolTipText=%1
DynamicVariables=1
[MeterItem4]
Meter=String
MeasureName=MeasureItem4Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem4Link]"]
ToolTipText=%1
DynamicVariables=1
[MeterItem5]
Meter=String
MeasureName=MeasureItem5Title
MeterStyle=TextStyle
LeftMouseUpAction=["[MeasureItem5Link]"]
ToolTipText=%1
DynamicVariables=1
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Automatically switch rss reader
Well, eclectic-tech already found that the address was the problem, so now you mostly only have point 3 above, the hard work is behind you thanks to the manual. Even if you wrote everything already done by yourself, if you look closely at the code, it's mainly lots of repetitive stuff, with only a few places where the "secret" of it is located, so not that much of an effort as it seemed at first, is it?
-
- Posts: 31
- Joined: January 27th, 2021, 8:05 pm
Re: Automatically switch rss reader
Thank you electric !!!
The code works fine.
Now, how do i show every news item every 10 seconds, i have seen it before in a skin called "illustro reader", but i want to show just 1 news item every 10 seconds. without title. just the article.
Like the first image posted.
The code works fine.
Now, how do i show every news item every 10 seconds, i have seen it before in a skin called "illustro reader", but i want to show just 1 news item every 10 seconds. without title. just the article.
Like the first image posted.
-
- Rainmeter Sage
- Posts: 5519
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Automatically switch rss reader
You need a calc measure that counts from 1 to 10, updating every 10 seconds. When it updates, set the Measurename and LeftMouseUpActions options in a new [NewsMeter] using the !SetOption bang.dasiun wrote: ↑August 18th, 2024, 3:02 am Thank you electric !!!
The code works fine.
Now, how do i show every news item every 10 seconds, i have seen it before in a skin called "illustro reader", but i want to show just 1 news item every 10 seconds. without title. just the article.
Like the first image posted.
Code: Select all
[MeasureCount10]
Measure=Calc
Formula=(MeasureCount10%10)+1
UpdateDivider=10
OnUpdateAction=[!SetOption NewsMeter MeasureName "MeasureItem[MeasureCount10]Title"][!SetOption NewsMeter LeftMouseUpAction """["[MeasureItem[MeasureCount10]Link]"]"""][!UpdateMeter *][!Redraw]
Code: Select all
[MeasureSite]
Measure=WebParser
URL=https://news.google.com/news/feeds?output=rss
RegExp=(?siU)<title>(.*)</title>.*<link>(.*)</link>#Item##Item##Item##Item##Item##Item##Item##Item##Item##Item#
Code: Select all
;Item 6 info
[MeasureItem6Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=13
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem6Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=14
;Item 7 info
[MeasureItem7Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=15
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem7Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=16
;Item 8 info
[MeasureItem8Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=17
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem8Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=18
;Item 9 info
[MeasureItem9Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=19
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem9Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=20
;Item 10 info
[MeasureItem10Title]
Measure=WebParser
URL=[MeasureSite]
StringIndex=21
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#Sub#
[MeasureItem10Link]
Measure=WebParser
URL=[MeasureSite]
StringIndex=22
Remove all other STRING METERS. Keep only this one and your [MeterBackground] image meter.
Code: Select all
[NewsMeter]
Meter=String
MeasureName=
MeterStyle=TextStyle
Y=10
LeftMouseUpAction=
ToolTipText=%1
DynamicVariables=1
You need to modify H in your style section. May want to change the size of your font and background colors.
Code: Select all
[TextStyle]
X=5
Y=4R
W=280
H=350
FontFace=Segoe UI
FontSize=24
FontColor=255,255,255,255
SolidColor=0,0,0,1
ClipString=1
AntiAlias=1
ToolTipWidth=300
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::