short question about rss feed from theweathernetwork.com in U.S.

Could someone please tell me if the rss feed from theweathernetwork.com in the U.S. gives the temperature in Celsius or in Fahrenheit?
Try any city in the U.S, such as for example Portland,OR: The Weather Network - Portland, Oregon

Thank you.

I do not understand what you mean. All the temperatures on that page are in ⁰C as is clearly indicated.

Yes It is in ⁰C. My question is do you see the temperature in ⁰C if you read this page (or any rss feed from theweathernetwork.com) with a U.S. ip. If it’s in ⁰C, it’s kind of wrong for the Americans (and I will convert it to fahrenheit). You need to be in the U.S. to answer this question.

On Sun, 02 Sep 2012 19:26:02 +0000, please try again wrote:

> Could someone please tell me if the rss feed from theweathernetwork.com
> in the U.S. gives the temperature in Celsius or in Fahrenheit?
> Try any city in the U.S, such as for example Portland,OR: ‘The Weather
> Network - Portland, Oregon’
> (http://rss.theweathernetwork.com/weather/usor0275)

That URL shows me the historic information in C and current in C with F
specified.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

You think it will localize according to my IP address. Thus I need a proxy :wink:

Hmmm…
Jim, do you mind wgetting this xml file and posting it here?

$ wget  http://rss.theweathernetwork.com/weather/usor0275

Actually I try not to think at this point. I just want to see what people see in the U.S. theweathernetwork.com is a Canadian website, and it’s normal for Canadians to see the temperature in Celsius. But if you use this info from the U.S, you should see the temperature in F. At least, it would seem logical.

To be more specific, I need to know if this command produces the same output if you run in in the U.S. or in Canada (or anywhere else):

 cat usor0275.xml | tr  -d "
	&" | sed 's|  | |g;s|nbsp;| |g;s|amp;||g;s|deg;||g;s|, Low |/|g;s|High ||g' | xsltproc weather.xslt -

Where usor0275.xml is the RSS feed for Portland, OR - in this example, and weather.xslt this extensible stylesheet:

<?xml version="1.0" encoding="ISO-8859-1"?>
     
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:func="http://exslt.org/functions"
        extension-element-prefixes="func">

<xsl:output method="text" disable-output-escaping="yes" encoding="utf-8"/>
<xsl:decimal-format decimal-separator="." grouping-separator=","/>

<xsl:template match="/">Weather (<xsl:value-of select="substring-after(//title, ' - ')"/>)
<xsl:for-each select="//item"><xsl:call-template name="list-node"/></xsl:for-each>
</xsl:template>

<xsl:template name="list-node">
<xsl:variable name="Conditions"><xsl:value-of select="substring-before(description, ',')"/></xsl:variable>
<xsl:variable name="Temperature"><xsl:value-of select="substring-before(substring-after(description, ','), ',')"/></xsl:variable>
<xsl:variable name="Humidity"><xsl:value-of select="substring-before(substring-after(description, 'Humidity'), ',')"/></xsl:variable>
<xsl:variable name="Wind"><xsl:value-of select="substring-after(description, 'Wind')"/></xsl:variable>
<xsl:choose>
<xsl:when test="contains(title, 'Current')">Temperature: <xsl:value-of select="$Temperature"/>
Conditions: <xsl:value-of select="$Conditions"/>
Humidity: <xsl:value-of select="$Humidity"/>
Wind: <xsl:value-of select="$Wind"/>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Here’s the ouput I get (from Canada):


Weather (Portland, Oregon)
Temperature: 18 C
Conditions: A few clouds
Humidity: 56%
Wind: calm

On 2012-09-02 22:06, please try again wrote:
>
> Yes It is in ⁰C. My question is do you see the temperature in ⁰C if
> you read this page (or any rss feed from theweathernetwork.com) with a
> U.S. ip. If it’s in ⁰C, it’s kind of wrong for the Americans (and I
> will convert it to fahrenheit).

Doing clever things based on the IP is wrong, IMO. It is best to let the use choose his preferences.

For instance, I have a Canadian ebook readier, a Kobo. Well, I live in Spain, and it insists in
trying to sell me Spanish ebooks, based on my IP, which breaks my purpose of buying it for reading
English language books.

Another one. Years ago I worked for Lucent, in Spain. The internal network had USA IPs (an entire A
range, IIRC). When we wanted to browse local Spanish info we had to navigate out of the USA based
info the web sites offered us.

I hate geo-ip cleverness…

Let the user choose his locale. Or better, use the locale defined units.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

You don’t kow what I’m doing. I don’t have influence on this RSS feed. I just want to be able parse it in the same way from anywhere. And for this, I need to know if the Americans get the same xml file I do. What is wrong (because there is indeed something wrong) is to use a human readable rss feed (which might change) instead of a machine readable api (but see this post
http://forums.opensuse.org/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/464737-easy-configuring-conky-conkyconf-2.html#post2482871).

That’s not the problem. I did actually implement this feature a while ago.

On Sun, 02 Sep 2012 20:36:02 +0000, please try again wrote:

> Jim, do you mind wgetting this xml file and posting it here?

Here’s a typical entry from the file:


<item>
<title>Wednesday, September 5, 2012</title>
<link>http://www.theweathernetwork.com/index.php?product=weather&placecode=usor0275&ref=day3#ltermfx</link>
<guid>http://www.theweathernetwork.com/index.php?product=weather&placecode=usor0275&ref=day3#ltermfx</guid>
<pubDate>Sun, 02 September, 2012, 03:19:00 PDT</pubDate>
<description>
Sunny,
High 31&nbsp;&deg;C, Low 12&nbsp;&deg;C, P.O.P. 0%
</description>
</item>

(Minus any code tags, posting from NNTP and using the BBcode, not sure if
that works or not so I guess we’ll find out. :slight_smile: )

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Thanks. It’s the same here - I don’t see Fahrenheit in there. But I’m done. It should work.

http://forums.opensuse.org/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/464737-easy-configuring-conky-conkyconf-2.html#post2483574

I live in the U.S. & it gives the temperature in Celsius

Thank You,