It is currently March 29th, 2024, 7:03 am

Length of RSS Feed Output

Get help with creating, editing & fixing problems with skins
User avatar
Grasshopper
Posts: 7
Joined: October 30th, 2017, 8:51 am

Length of RSS Feed Output

Post by Grasshopper »

Hey Guys, i try to create a "Rss Feed Reader Gadget"

It works so long, but i want to fix it into a specific size.
The Text are too long.

Image

Is there any solution to set a maximum length of the Output Text.

Code: Select all

RSS=#URL#?pz=1&ned=us&hl=en&topic=h&num=10&output=rss
SubstituteFeed="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"
SubstituteLink="&":"&","<![CDATA[":"","]]>":""
Player=WMP
MusicDir=

[Feed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#URL#?pz=1&ned=us&hl=en&topic=h&num=10&output=rss
RegExp="(?siU)<title.*>(.*)</title>.*<link.*>(.*)</link>.*<item.*<title.*>(.*)</title>.*<link.*>(.*)</link>(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)"
StringIndex=1
Substitute="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"

[FeedURL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=2
Substitute="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"
Regards!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Length of RSS Feed Output

Post by jsmorley »

Sure, simply set a value for W on the meter, and add ClipString=1

That will limit the width of the string displayed to W pixels, and will truncate (clip) the string if it is longer than that, adding "..." an ellipses, to the end.

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1

[MeterOne]
Meter=String
W=300
ClipString=1
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Now is the time for all good men to come to the aid of their country
https://docs.rainmeter.net/manual/meters/string/#ClipString
1.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Length of RSS Feed Output

Post by jsmorley »

User avatar
Grasshopper
Posts: 7
Joined: October 30th, 2017, 8:51 am

Re: Length of RSS Feed Output

Post by Grasshopper »

Thank for the fast Answer... and it works partially...
Image

The Name of the first Feed overlaps the second Feed.

Code: Select all

[Feedtext]
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
ClipString=1
FontColor=60,179,255,150
FontEffectColor=0,0,0,20
FontFace=Arial
FontSize=7
AntiAlias=1
AutoScale=1
X=17
Y=12r
W=163
What is wrong?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Length of RSS Feed Output

Post by jsmorley »

Don't have enough of your code to be sure, but I suspect a typo somewhere in the Y value for one or more of the string meters.
User avatar
Grasshopper
Posts: 7
Joined: October 30th, 2017, 8:51 am

Re: Length of RSS Feed Output

Post by Grasshopper »

i 've send you the complete code via PM :bow:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Length of RSS Feed Output

Post by jsmorley »

Grasshopper wrote:i 've send you the complete code via PM :bow:
Sorry, but I don't do private support. Nothing about your skin is something that can't be public.
User avatar
Grasshopper
Posts: 7
Joined: October 30th, 2017, 8:51 am

Re: Length of RSS Feed Output

Post by Grasshopper »

Code: Select all

[Metadata]
Name=RSS Feed Module
Author=-
Information=-
Version=1.0
License=GNU GPL v2
      
;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Rainmeter]
Background=GFX/Background.png
Update=1000

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Screen]
Meter=Image
ImageName=GFX/Shade.png

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Variables]
@Include=SET\Settings.inc

;-=-=-=-=-=-=-=-=-=-=-=-=-;
;     RSS FEED SOURCE     ;
;-=-=-=-=-=-=-=-=-=-=-=-=-;

RSS=#URL#?pz=1&ned=us&hl=en&topic=h&num=10&output=rss
SubstituteFeed="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"
SubstituteLink="&":"&","<![CDATA[":"","]]>":""
Player=WMP
MusicDir=

;-=-=-=-=-=-=-=-=-=-=-=-=-;
;      LABEL DISPLAY      ;
;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Title]
Meter=String
MeasureName=Feed
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
ClipString=1
FontColor=255,255,255,205
FontEffectColor=0,0,0,20
FontFace=Trebuchet MS
FontSize=9
AntiAlias=1
AutoScale=1
Text="%1"
ToolTipText="%1"
X=25
Y=6
W=143

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Icon]
Meter=Image
ImageName=GFX/RSS.png
X=20
Y=0

;-=-=-=-=-=-=-=-=-=-=-=-=-;
;     OUTPUT DISPLAY      ;
;-=-=-=-=-=-=-=-=-=-=-=-=-;

[StyleItem]
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
ClipString=1
FontColor=60,179,255,150
FontEffectColor=0,0,0,20
FontFace=Arial
FontSize=7
AntiAlias=1
AutoScale=1
X=17
Y=12r
W=163

[StyleLink]
StringAlign=Left
StringCase=None
StringStyle=Regular
StringEffect=Shadow
ClipString=1
FontColor=255,255,255,255
FontEffectColor=0,0,0,20
FontFace=Arial
FontSize=7
AntiAlias=1
AutoScale=1
Hidden=1
X=r
Y=r

;-=-=-=-=-=-=-=-=-=-=-=-=-;
;          FEEDS          ;
;-=-=-=-=-=-=-=-=-=-=-=-=-;

[Feed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#URL#?pz=1&ned=us&hl=en&topic=h&num=10&output=rss
RegExp="(?siU)<title.*>(.*)</title>.*<link.*>(.*)</link>.*<item.*<title.*>(.*)</title>.*<link.*>(.*)</link>(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)"
StringIndex=1
Substitute="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"

[FeedURL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=2
Substitute="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"ä","&#246;":"ö","&#8211;":"–"

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=3
Substitute=#SubstituteFeed#

[MeasureLink1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=4
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=5
Substitute=#SubstituteFeed#

[MeasureLink2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=6
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=7
Substitute=#SubstituteFeed#

[MeasureLink3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=8
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=9
Substitute=#SubstituteFeed#

[MeasureLink4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=10
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem5]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=11
Substitute=#SubstituteFeed#

[MeasureLink5]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=12
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem6]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=13
Substitute=#SubstituteFeed#

[MeasureLink6]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=14
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=15
Substitute=#SubstituteFeed#

[MeasureLink7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=16
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureItem8]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=17
Substitute=#SubstituteFeed#

[MeasureLink8]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=18
Substitute=#SubstituteLink#

;-=-=-=-=-=-=-=-=-=-=-=-=-;
;        COMMANDS         ;
;-=-=-=-=-=-=-=-=-=-=-=-=-;

[MeasureSetCommands]
Measure=Plugin
Plugin=InputText
Command1=!WriteKeyValue Variables URL "$UserInput$" DefaultValue="http://rss.cnn.com/rss/edition.rss" X=10 Y=23 H=28 W=176 "SET\Settings.inc"
Command2=!Refresh

[MeterSetHardDisk]
Meter=String
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontColor=255,255,255,20
FontEffectColor=0,0,0,20
FontFace=Arial
FontSize=6
AntiAlias=1
Text=SET
X=6
Y=7
LeftMouseDownAction=!CommandMeasure "MeasureSetCommands" "ExecuteBatch 1-2"
ToolTipIcon=Info
ToolTipTitle=Enter the RSS Feed Link which should be displayed.
ToolTipText=Press Left Mousebutton. Confirm with Enter!
ToolTipType=0

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText1]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem1
X=17
Y=23
H=40
W=135
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink1][!RainmeterHideMeter FeedOutputText1]
ToolTipText="%1"

[FeedOutputLink1]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem1
X=0r
LeftMouseUpAction=!Execute [[MeasureLink1]][!RainmeterShowMeter FeedOutputText1][!RainmeterHideMeter FeedOutputLink1]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText2]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem2
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink2][!RainmeterHideMeter FeedOutputText2]
ToolTipText="%1"

[FeedOutputLink2]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem2
X=0r
LeftMouseUpAction=!Execute [[MeasureLink2]][!RainmeterShowMeter FeedOutputText2][!RainmeterHideMeter FeedOutputLink2]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText3]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem3
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink3][!RainmeterHideMeter FeedOutputText3]
ToolTipText="%1"

[FeedOutputLink3]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem3
X=0r
LeftMouseUpAction=!Execute [[MeasureLink3]][!RainmeterShowMeter FeedOutputText3][!RainmeterHideMeter FeedOutputLink3]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText4]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem4
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink4][!RainmeterHideMeter FeedOutputText4]
ToolTipText="%1"

[FeedOutputLink4]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem4
X=0r
LeftMouseUpAction=!Execute [[MeasureLink4]][!RainmeterShowMeter FeedOutputText4][!RainmeterHideMeter FeedOutputLink4]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText5]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem5
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink5][!RainmeterHideMeter FeedOutputText5]
ToolTipText="%1"

[FeedOutputLink5]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem5
X=0r
LeftMouseUpAction=!Execute [[MeasureLink5]][!RainmeterShowMeter FeedOutputText5][!RainmeterHideMeter FeedOutputLink5]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText6]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem6
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink6][!RainmeterHideMeter FeedOutputText6]
ToolTipText="%1"

[FeedOutputLink6]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem6
X=0r
LeftMouseUpAction=!Execute [[MeasureLink6]][!RainmeterShowMeter FeedOutputText6][!RainmeterHideMeter FeedOutputLink6]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText7]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem7
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink7][!RainmeterHideMeter FeedOutputText7]
ToolTipText="%1"

[FeedOutputLink7]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem7
X=0r
LeftMouseUpAction=!Execute [[MeasureLink7]][!RainmeterShowMeter FeedOutputText7][!RainmeterHideMeter FeedOutputLink7]

;-=-=-=-=-=-=-=-=-=-=-=-=-;

[FeedOutputText8]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem8
X=0r
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink8][!RainmeterHideMeter FeedOutputText8]
ToolTipText="%1"

[FeedOutputLink8]
Meter=String
MeterStyle=StyleLink
MeasureName=MeasureItem8
X=0r
LeftMouseUpAction=!Execute [[MeasureLink8]][!RainmeterShowMeter FeedOutputText8][!RainmeterHideMeter FeedOutputLink8]
URL=http://rss.cnn.com/rss/edition.rss
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Length of RSS Feed Output

Post by jsmorley »

In this meter:

Code: Select all

[FeedOutputText1]
Meter=String
MeterStyle=StyleItem
MeasureName=MeasureItem1
X=17
Y=23
H=40
W=135
LeftMouseDownAction=!execute [!RainmeterShowMeter FeedOutputLink1][!RainmeterHideMeter FeedOutputText1]
ToolTipText="%1"
Remove the H and W options. The W option is redundant and conflicts with the MeterStyle, and more importantly, the H option makes the meter "tall" enough to fit two lines of text at the defined FontSize, and so it "wraps" instead of "clipping".
User avatar
Grasshopper
Posts: 7
Joined: October 30th, 2017, 8:51 am

Re: Length of RSS Feed Output

Post by Grasshopper »

Just Great. O.O

Many Thanks jsmorley :17good

Best Regards!
:welcome: