It is currently April 20th, 2024, 11:44 am

handling double encoded feeds

Tips and Tricks from the Rainmeter Community
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

handling double encoded feeds

Post by moshi »

double encoded feeds can be annoying, but with Brian's new RunCommand plugin http://rainmeter.net/forum/viewtopic.php?f=18&t=16715 and the recode app from the UnxUtils http://sourceforge.net/projects/unxutils/, there's a way to handle them.

just put recode.exe in your path and let it it do it's job when the WebParser plugin has finished.

Code: Select all

[MeasureWebparser1]
Measure=Plugin
Plugin=WebParser
Url=https://drupal.org/node/1424096
RegExp="(?siU).*<div class="codeblock"><code><channel><br />    (.*)<br />"
DecodeCharacterReference=0
FinishAction=[!UpdateMeter *][!Redraw]
StringIndex=1

[MeasureWebparser2]
Measure=Plugin
Plugin=WebParser
Url=https://drupal.org/node/1424096
RegExp="(?siU).*<div class="codeblock"><code><channel><br />    (.*)<br />"
DecodeCharacterReference=1
FinishAction=[!UpdateMeasure Command_1][!CommandMeasure Command_1 Run]
StringIndex=1

[Command_1]
Measure=Plugin
Plugin=RunCommand
DynamicVariables=1
Parameter="echo "[MeasureWebparser2]" | "#@#addons\recode.exe" html...utf8"
OutputType=UTF8
RegExpSubstitute=1
Substitute="\n":"","\r":"",'^"':"",'" $':""
FinishAction=[!UpdateMeter *][!Redraw]
example skin attached.


Edit: the regular expression in the example skin no longer works. i am too lazy to update.
You do not have the required permissions to view the files attached to this post.
Last edited by moshi on October 22nd, 2014, 11:00 am, edited 2 times in total.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: handling double encoded feeds

Post by fonpaolo »

Never encountered one until now, but this could come handy... bookmarked. :D