It is currently May 8th, 2024, 8:03 am

RSS Feed Help

Get help with creating, editing & fixing problems with skins
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

RSS Feed Help

Post by cwfrizzell »

I'm pulling in the following feed for a skin:

http://currencyratecalculator.com/gadget/rssfeed.php

It gives the first result as 1 USD = EUR (0.69039)

This is as expected. However, I would like to do two things with it:

1. Lose the "1 USD = " so it just displays EUR (0.69039)
2. Extract the number within the parenthesis to perform another calculation

I realize this is probably just RepExp stuff, but need some help with the syntax. Searching for RegExp help around the Net has just led to more confusion. I appreciate any help!
Cheers!

Chuck
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: RSS Feed Help

Post by poiru »

This will fetch the numerical value (which you can use for further calculation):

Code: Select all

[USDinEUR]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=14400
Url=http://currencyratecalculator.com/gadget/rssfeed.php
RegExp="(?siU)EUR \((.*)\)"
StringIndex=1
If you want to display that value as is, add the following to a STRING meter to display something like "EUR (0.6903)":

Code: Select all

MeasureName=USDinEUR
Text="EUR (%1)"
NumOfDecimals=4
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: RSS Feed Help

Post by cwfrizzell »

poiru wrote:This will fetch the numerical value (which you can use for further calculation):

Code: Select all

[USDinEUR]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=14400
Url=http://currencyratecalculator.com/gadget/rssfeed.php
RegExp="(?siU)EUR \((.*)\)"
StringIndex=1
If you want to display that value as is, add the following to a STRING meter to display something like "EUR (0.6903)":

Code: Select all

MeasureName=USDinEUR
Text="EUR (%1)"
NumOfDecimals=4
Thanks! And wouldn't you know, I'm working on a Gnometer ini!
Cheers!

Chuck
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: RSS Feed Help

Post by cwfrizzell »

Continuing with this ini... I'm pulling data from multiple places. Here's a webpage that is technically a RSS feed:

Code: Select all

<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>FedSmith.com - Daily TSP Rates</title>
<link>http://www.fedsmith.com/corners/tsp</link>
<description>Daily TSP rates provided by FedSmith.com</description>
<language>en-us</language>
<copyright>Copyright 2011 FedSmith.com</copyright>

<image>
<title>FedSmith.com - For the Informed Fed</title>

<url>http://www.fedsmith.com/headlines/headlines_logo.gif</url>
<link>http://www.fedsmith.com</link>
<width>126</width>
<height>41</height>
</image>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/fedsmith/tspdailyrates" /><feedburner:info uri="fedsmith/tspdailyrates" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
<title>TSP Share Prices for April 8, 2011</title>
<link>http://www.fedsmith.com/corners/tsp</link>
<description><ul>

<li>G Fund - $13.5944 - Change: 0.00</li>
<li>F Fund - $14.2506 - Change: -0.00</li>
<li>C Fund - $16.1454 - Change: -0.06</li>
<li>S Fund - $22.9192 - Change: -0.18</li>
<li>I Fund - $21.1794 - Change: 0.28</li>

<li>L 2050 Fund - $10.3829 - Change: 0.00</li>
<li>L 2040 Fund - $18.7468 - Change: 0.00</li>
<li>L 2030 Fund - $18.2089 - Change: 0.00</li>
<li>L 2020 Fund - $17.6147 - Change: 0.01</li>
<li>L Income Fund - $14.9540 - Change: 0.00</li>

</ul>
</description>
<guid isPermaLink="false">1972@http://www.fedsmith.com/corners/tsp</guid>
<pubDate>Fri, 8 Apr 2011 21:00:00 CST</pubDate>
</item>


</channel>
</rss>
As a standard feed, it shows the feed title only. I want to use the the actual data as a feed (G Fund, F Fund, etc toward the bottom of the code), meaning I have to screen scrape it. How is that done?
Cheers!

Chuck
steve
Posts: 1
Joined: April 13th, 2011, 12:28 pm

Re: RSS Feed Help

Post by steve »

Have a look here http://www.submit-rss.com/download.html ! enjoy !
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: RSS Feed Help

Post by cwfrizzell »

steve wrote:Have a look here http://www.submit-rss.com/download.html ! enjoy !
Really? That doesn't make sense to me at all, nor am I looking to "advertise" anything. And for a fee? I don't think so.

Anybody else willing to advise, because I'm at a loss. One would think this would be easier...
Cheers!

Chuck
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: RSS Feed Help

Post by cwfrizzell »

After a bit of research (okay, a LOT!), I was able to solve the problem going another route. I actually used http://www.feed43.com to make an RSS feed from the page I wanted, then used Gnometer's already built feed.ini to make things work.

For those who use TSP (US gov, military), you can grab the feed here: http://www.feed43.com/daily_tsp_rates2.xml
Cheers!

Chuck