Okay, maybe I just need a Blue Monster and some sleep, but....
I'm scraping a ringtone site just so that I can download all of the ringtones and add them to my personal library.
The website's code that I am targeting is:
Code: [Select]<tr><td><a href="/ringtone/527783/"><img src="/img/icon/ringt.jpg" border=0>Jackson 5 - Who's Loving You </a> </td><td align=center><a href="/ringtones/classical/" class=cat_link>Classical</a></td><td align=center><img src="/img/rating/star0.gif" border=0></td><td align="right" class=smgrey2>5 months ago</td><td align="center" class=smgrey2><span class="b">13895</span></td><td align="right"><span class="b"><a href="/profile/stambaugh01">stambaugh01</a></span></td></tr>
I would like for it to output the actual filename which in this case would be 527783. I would also like for it to output the title of the file.
There are about 50 or so listings per page, and would like for it to automatically go to the next page to scrape.
Here is my code:
Code: [Select]<?
$data = @file_get_contents("http://www.XXXXXXXXXXXX.com/ringtones/classical/");
preg_match_all('/href="/ringtone/.*?<img src="/img/icon/ringt.jpg" border=0>([^"]*).*?/"><img src="/img/icon/.*?border=0>([^"]*)</td><td align=center>/is',$data,$out);
// preg_match_all('/href="/ringtone/.*?<img src="/img/icon/ringt.jpg" border=0>([^"]*).*?/"><img src="/img/icon/.*?border=0>([^"]*)</td><td align=center>/is',$data,$out);
if ((isset($out[1]) && isset($out[2])) === FALSE) { // Let's do some error checking to see if there is data to insert into the database. If not let's end the script
break;
}
$d = array_combine($out[1], $out[2]);
// End Error Checking
foreach($d as $k=>$v){
echo $k . " --- " . $v . "
";
}
?>
The output is skipping and only outputting the title of every other row, but now directory name.
Thanks in advance for the help.
How to show a complete textarea ??
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 chars wide , using the scroll bar to see beyond 5 lines.After entering notes, I want to echo or print
listing help
Hi,at first, great new design!!! I like it,i got a problem,I want to list some tekst, but there is a users, users can list they own texts, and all teksts, and find words in all texts and in own
Can't seem to capture a variable in a chained select
I'm *this* close to having a chained select running but for some reason it doesn't seem to be picking up a variable.Code: <?phprequire ('inc/connection.php');//seeming that we are just
Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I have been working on this problem for 3 days and have had no luck!Here we go:I have a rate and
Call Screen statement Error
Dear Experts,
php/xmlrpc class issue
I am working on xml-rpc in php to start with.I have a class that only has variables defined in it. I have defined an object to this class. Now what i want to do is that i want to send a 'true copy' of
All possible combinations of String in PL/SQL
Hi All,
xApp Analytics in BI 7.0
Dear all,
Stats of viewers
Hello. I have a website in php and people can login. I want to make an admin control panel where u can see how many people are currently logged in and also how many people in total (including the ones
Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.I need to create a dropdown list of months, where the starting month is current month and the ending month is the previous months 2