how to auto grab text from another website

Discussion in 'HTML & Website Design' started by d1343, May 7, 2009.

  1. #1
    I am making website for local city
    I am trying to make page for movie timing
    I am trying grabbing text from
    Code:

    bigscreen.com
    Code (markup):
    or
    Code:

    http://www.movietickets.com/house_detail.asp?afid=wibsc&house_id=4266
    Code (markup):
    for movie timings on my website.
    I dont want to do some dumb stuff like inline frame and sutff like that, I want to grab text only for theater name movie name & timings.
    thank you for your time.
     
    d1343, May 7, 2009 IP
  2. Progg

    Progg Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, with PHP this is easy, but you have to have a good knowledge of regular expressions. I use preg_match() to do similar things. For example, if tag <div id="test">Grab this text</div> you can grab it with

    preg_match("/<div id=\"test\">(.*)<\/div>/is",$html,$matches);

    then the text you want is assigned to matches[1] as a submatch

    it's very powerful but can be a little tricky
     
    Progg, May 7, 2009 IP