Page 1 of 2 12 LastLast
Results 1 to 10 of 13

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

  1. #1

    Default 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.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,281

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

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

  3. #3

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

    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.

  4. #4
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,078

    Default Re: short question about rss feed from theweathernetwork.com inU.S.

    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

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,281

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

    Quote Originally Posted by please_try_again View Post
    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.
    You think it will localize according to my IP address. Thus I need a proxy
    Henk van Velden

  6. #6

    Default Re: short question about rss feed from theweathernetwork.com inU.S.

    Quote Originally Posted by hendersj View Post
    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'
    > (The Weather Network - Portland, Oregon)


    That URL shows me the historic information in C and current in C with F
    specified.
    Hmmm..
    Jim, do you mind wgetting this xml file and posting it here?

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

  7. #7

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

    Quote Originally Posted by hcvv View Post
    You think it will localize according to my IP address. Thus I need a proxy
    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.

  8. #8

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

    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):

    Code:
     cat usor0275.xml | tr  -d "\r\n\t&" | 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:

    Code:
    <?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):

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

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

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

    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))

  10. #10

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

    Quote Originally Posted by robin_listas View Post
    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.
    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/g...ml#post2482871).

    Quote Originally Posted by robin_listas View Post
    Let the user choose his locale. Or better, use the locale defined units.
    That's not the problem. I did actually implement this feature a while ago.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •