I want to open links in order/one-by-one and check each for a specific string.
Example:
If i open CL, search for ads pertaining to video games. Returns 20 results. I grab these links. Now i want to open each of these links one-by-one to see if an email address is included.
As of now i am able to retrieve the links, but need to know how to parse them one-by-one to check the email address.
I will then either copy the address or immediately return back to the list of links if the address is non-existent.
So here's my current code for this process thus far.
Code: [Select] <?php
function curlURL($url) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2');
$output = curl_exec($curl);
return $output;
}
$curlResults = curlURL("http://southcoast.craigslist.org/sss/");
$pattern = '#<a href="(/[a-z]{3}/d{10}.html)">#';
preg_match_all( $pattern, $curlResults, $matches);
echo "<pre>n";
echo "Links:nn";
foreach ($matches[1] as $link):
echo "t" . '<a href="' . $link . '" target="_BLANK">' . $link . '</a>' . "n";
endforeach;
echo '</pre>';
?>
How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........a b v1 v2 v3 v4c d v5 v6 v7 v8e f v9 v10 v11 v12 . .
Date Question
I'm using the TIMESTAMP() function within mysql to set the date/time for certain events. However, how would I go about formatting the output? For example it would display "2009-11-30
How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info going to the database gets there securely?
Problem with a select distinct
I have a problema with a select distinct, I have the next sql:
login page does not execute a else statement
I've created a login page using sessions.When an incorrect user name or password is entered then a custom messege error message apears.But if a correct user name and password is used then notthing
Remove letter from numeric textbox
I have a textbox that will search the employee database by entering in the employee ID and it will return the result on the same page.QueryCode: if(isset($_GET['findagentid']) &&
Need Reporting Advice
My SQL server doesn't support MS SQL reporting services that comes with SQL Enterprise or Express. Then the administrator suggested that I google for alternatives. I'm a newbie and don't even know
Insert to MySQL inside foreach
Hey.I am parsing some html, and putting inside an html db.I need to create a randomized integer to be a unique identifier, and i chose just to use time().But I foreach the results, and inside here i
Move array index to end
Hey guys, Quick question: I have an array that looks like this:Code: [Select]$var = array( 'name' => 'thename', 'title' => 'thetitle', 'media'
How could I combine these arrays??
Hello.. I'm trying to figure out a way to combine these first two arrays to get the last array.. 1st array:Code: Array( [0] => zero [1] => one [2] => two)2nd array:Code: