Subversion Repository Public Repository

Nextrek

@ 58
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
function prepare_wget($url)
{

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);

	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60000);
	curl_setopt($ch, CURLOPT_TIMEOUT, 60000);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)');

	return $ch;
}

function wget($url)
{
	// create curl resource
	$ch = prepare_wget($url);

	// $output contains the output string
	$output = curl_exec($ch);

	// close curl resource to free up system resources
	curl_close($ch);

	return $output;
}

function println($data)
{
	$msg = Date('Ymd H:i:s').' '.$data;
	echo $msg."\n";
	error_log($data);
	flush();
	ob_flush();
}

?>

Commits for Nextrek/Web/epg/utils.php

Diff revisions: vs.
Revision Author Commited Message
9 DRuega picture DRuega Mon 06 May, 2013 21:54:02 +0000

Ripristinato EPG