Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherProject Help Wanted

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 17th, 2003, 12:44 PM
pilla pilla is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 11 pilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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/se...id=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.

Reply With Quote
  #2  
Old January 17th, 2003, 12:56 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
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.

Reply With Quote
  #3  
Old January 18th, 2003, 06:06 AM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
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.
__________________
And you know I mean that.

Last edited by AlCapone : January 18th, 2003 at 06:11 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherProject Help Wanted > Need php help -- will pay


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway