Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2007
    Posts
    34
    Thanks
    9
    Thanked 0 Times in 0 Posts

    javascript or jquery select text without proper html tags

    I'm trying to use a poorly designed rss feed from weather bug for a website. I'm trying to retrieve the information to put in an already styled widget.

    The RSS i have parsed is:
    PHP Code:
    <div>
    <
    img src="http://deskwx.weatherbug.com/images/Forecast/icons/cond999.gif" border="0" alt="" width="50" height="42"/>&nbsp;&nbsp;&nbsp;
    <
    b>Unknown</b> <br />
    <
    b>Temperature:</b50.4 &deg;F<br />
    <
    b>Humidity:</b81 %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Dew Point:</b45? &deg;<br />
    <
    b>Wind Speed:</b5 mph W &nbsp;&nbsp; <b>Gusts:</b18 mph WSW<br />
    <
    b>Pressure:</b29.95 &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Rain Today:</b0.00 &quot;<br />
    </
    div
    I basically need to select and extract:
    temperature, rain chance, pressure, wind speed, gusts, dew point, and humidity...

    I've tried doing selecting all the <b> tags but I don't know how to get the nex text node after the closing b tag.

    Any help will greatly be appreciated.
    Last edited by weaksauce; 10-10-2012 at 08:52 PM.
    Time after Time

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,762
    Thanks
    55
    Thanked 517 Times in 514 Posts
    can you provide the link to the rss feed? It may be easier dealing directly with the output

  • #3
    New Coder
    Join Date
    Nov 2007
    Posts
    34
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Time after Time

  • #4
    New Coder
    Join Date
    Nov 2007
    Posts
    34
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I was able to find an API and use JSON to retrieve the data instead.

    http://developer.weatherbug.com/docs...erBug_API_JSON
    Time after Time


  •  

    Posting Permissions

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