-
Notifications
You must be signed in to change notification settings - Fork 0
/
crawl a website.txt
26 lines (21 loc) · 1.02 KB
/
crawl a website.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function get_web_page($url) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_ENCODING => "", // handle compressed
CURLOPT_USERAGENT => "test", // name of client
CURLOPT_AUTOREFERER => true, // set referrer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // time-out on connect
CURLOPT_TIMEOUT => 120, // time-out on response
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
$response = get_web_page("https://www.smsmobile24.com/components/com_spc/smsapi.php?username=nationdelivery%20express&password=nationdeliverycom&sender=TopMyLR.com&recipient=$recipient&message=$textmessage");
$resArr = array();
$resArr = json_decode($response);