SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Displaying a single element from another website

    I am trying to figure out if it is possible to pull a specific element (example: <td class="module"></td>) from another website and display it on my site. For example I want to display the "10-Day Forecast" for Chicago from this website (weather.com/weather/tenday/USIL0225) which is located in a table cell called (<td class="module"></td>). Currently I use an AJAX popup to display the entire page, but I would like to just show the actual table that contains the information I want.

    Is this possible? If so, what script would I need to get started?

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Weather.com has an rss feed which would seem to me to be the best way to display their content. Failing that it depends on what technology you are using. I'm an asp.net developer so I know I can screen scrap web pages and I'm sure it can be done using php but you're also entering into an area that might not please the site in question.

  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know asp.net or php for that matter. I was hoping to have a simple javascript solution to this problem. I realize that weather.com wants to have people see the entire page because of ad revenue. But this is only going to be going on my personal family website so I don't think they would care to much. I use Adblock Plus anyway

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are going to need some kind of server side technology to read rss or screen scrape.

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    They provide a service to add weather.com to your website
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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