#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    11
    Rep Power
    0

    Need php help -- will pay


    Hi All!
    I need some scripting and am willing to pay.
    Here are my reqs
    I am trying to extract content from this website
    http://www.smarterliving.com/air/sea...d=127&x=22&y=3
    This has all the latest travel deals from NY.
    Right now there are like 30deals listed there.
    I need just the first 4 deals on that page.
    I need a script in PHP to break at the 8th deal on that page just to get only the first 8 deals?
    I am not planning to use any db for this.


    Guys please let me know how much time you need and the amount also.
    Please email me at seatu@softhome.net
    Thanks for your help
    Pilla
    Last edited by pilla; January 17th, 2003 at 01:00 PM.
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    two things,
    1) your link is broken
    2) this should go in the help wanted forum, if you want to try and write this yourself and get stuck this is the perfect place to find the help you need.
  4. #3
  5. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    32
    PHP Code:
    function getdeals(){
    $sh=fsockopen('www.smarterliving.com',80,$errno,$error);
    if(!
    $sh) { trigger_error('cannot connect to the server in getdeals()',E_USER_WARNING); return; }
    fputs($sh,"GET /air/search/rates-nyc.php?id=127 HTTP/1.1\r\nHost:[url]www.smarterliving.com\r\n\r\n[/url]");
    while(!
    feof($sh)) $content.=fgets($sh,1024);
    fclose($sh);

    preg_match_all('!<TR><TD BGCOLOR="#\w{6}">[\r|\n|\s]+<SPAN CLASS="bodyText">.*?</tr>!s',$content,$m);
    foreach(
    $m[0] as $n){
        
    preg_match_all('#<SPAN CLASS="bodyText">.*?</span>#s',$n,$b);
        
    preg_match('#<A HREF="/air/restrictions.php\?id=\d+" CLASS="aBodyTextLink">.*</a>#s',$n,$v);
        
    $deals[]=array('Departure'=>trim(strip_tags($b[0][0])),'price'=>trim(strip_tags($b[0][1])),'arrival'=>trim(strip_tags($b[0][2])),'link'=>trim(str_replace('/air','http://www.smarterliving.com/air',$v[0])));
    }
    return 
    $deals;
    }
    var_dump(getdeals()); 
    That function will return all deals from that page in nice hash. Then you can get first however-many elements and do whatever you like with them. If you're going to use it feel free to donate me whatever you think it is worth.

    edited due to problems with highlighting.
    Last edited by AlCapone; January 18th, 2003 at 06:11 AM.
    And you know I mean that.

IMN logo majestic logo threadwatch logo seochat tools logo