PHP cURL crawler doesn't fetch all data - php

I'm trying to write my first crawler by using PHP with cURL library. My aim is to fetch data from one site systematically, which means that the code doesn't follow all hyperlinks on the given site but only specific links.
Logic of my code is to go to the main page and get links for several categories and store those in an array. Once it's done the crawler goes to those category sites on the page and looks if the category has more than one pages. If so, it stores subpages also in another array. Finally I merge the arrays to get all the links for sites that needs to be crawled and start to fetch required data.
I call the below function to start a cURL session and fetch data to a variable, which I pass to a DOM object later and parse it with Xpath. I store cURL total_time and http_code in a log file.
The problem is that the crawler runs for 5-6 minutes then stops and doesn't fetch all required links for sub-pages. I print content of arrays to check result. I can't see any http error in my log, all sites give a http 200 status code. I can't see any PHP related error even if I turn on PHP debug on my localhost.
I assume that the site blocks my crawler after few minutes because of too many requests but I'm not sure. Is there any way to get a more detailed debug? Do you think that PHP is adequate for this type of activity because I wan't to use the same mechanism to fetch content from more than 100 other sites later on?
My cURL code is as follows:
function get_url($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
$info = curl_getinfo($ch);
$logfile = fopen("crawler.log","a");
echo fwrite($logfile,'Page ' . $info['url'] . ' fetched in ' . $info['total_time'] . ' seconds. Http status code: ' . $info['http_code'] . "\n");
fclose($logfile);
curl_close($ch);
return $data;
}
// Start to crawle main page.
$site2crawl = 'http://www.site.com/';
$dom = new DOMDocument();
#$dom->loadHTML(get_url($site2crawl));
$xpath = new DomXpath($dom);

Use set_time_limit to extend the amount of time your script can run for. That is why you are getting Fatal error: Maximum execution time of 30 seconds exceeded in your error log.

do you need to run this on a server? If not, you should try the cli version of php - it is exempt from common restrictions

Related

Show CoreTemp Remote Monitoring Temperature on Webpage

I would like to show what CoreTemp is monitoring on my personal website. The CoreTemp reports in what I can tell JSON format. However, it appears that when I do a cron or a GET requests, nothing ever shows from the CoreTemp page. I think this may have to do with it must return 5 results before displaying it on the local webpage at http://localhost:5200/.
Example output from CoreTemp Monitoring page:
{"CpuInfo":
{"uiLoad":[2,3],
"uiTjMax":[100],
"uiCoreCnt":2,
"uiCPUCnt":1,
"fTemp":[49,48],
"fVID":1.065918,
"fCPUSpeed":3292.04028,
"fFSBSpeed":99.7588,
"fMultiplier":33,
"CPUName":"Intel Core i5 4310M (Haswell) ",
"ucFahrenheit":0,
"ucDeltaToTjMax":0,
"ucTdpSupported":1,
"ucPowerSupported":1,
"uiStructVersion":2,
"uiTdp":[37],
"fPower":[5.889584],
"fMultipliers":[33,33]},
"MemoryInfo":{
"TotalPhys":16282,
"FreePhys":8473,
"TotalPage":17304,
"FreePage":8473,
"TotalVirtual":8388608,
"FreeVirtual":8388003,
"FreeExtendedVirtual":1,
"MemoryLoad":47}}
Again, I'm getting stuck even to have any data show up from a simple GET or curl request from php.
Simple php code:
<?php
$exe = curl_init();
curl_setopt($exe, CURLOPT_URL, "http://localhost:5200/");
curl_setopt($exe, CURLOPT_HEADER, 0);
curl_setopt($exe, CURLOPT_RETURNTRANSFER, 1);
$raw = curl_exec($exe);
curl_close($exe);
echo $raw;
What am I missing or is this a problem with the Monitoring plug in itself?

PHP curl maximum execution time using hhvm

I am trying to download all the data from an api, so I am curling into it and saving the results a json file. But the execution stops and the results are truncated and never finishes.
How can this be remedied. Maybe the maximum execution time in the server of api cannot serve so long so it stops. I think there are more than 10000 results.
Is there a way to download the first 1000, 2nd 1000 results etc. and by the way, the api uses sails.js for their api,
Here is my code :
<?php
$url = 'http://api.example.com/model';
$data = array (
'app_id' => '234567890976',
'limit' => 100000
);
$fields_string = '';
foreach($data as $key=>$value) { $fields_string .= $key.'='.urlencode($value).'&'; }
$fields_string = rtrim($fields_string,'&');
$url = $url.'?'.$fields_string;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, '300000000');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
print($response);
$file = fopen("results.json", 'w+'); // Create a new file, or overwrite the existing one.
fwrite($file, $response);
fclose($file);
curl_close($ch);
Lots of possible problems might be the cause. Without more details that help understand if the problem is on the client or server, such as with error codes or other info, it's hard to say.
Given that you are calling the API with a URL, what happens when you put your URL into a browser? If you get a good response in a browser then it seems likely the problem is with your local configuration and not with node/sails.
Here are a few ideas to see if the problem is local, but I'll admit I can't say any one is the right answer because I don't have enough information to do better:
Check your php.ini settings for memory_limit, max_execution_time and if you are using Apache, the httpd.conf timeout setting. A test using the URL in a browser is a way to see if these settings may help. If the browser downloads the response fine, start checking things like these settings for reasons your system is prematurely ending things.
If you are saving the response to disk and not manipulating the data, you could try removing CURLOPT_RETURNTRANSFER and instead use CURLOPT_FILE. This can be more memory efficient and (in my experience) faster if you don't need the data in-memory. See this article or this article on this site for info on how to do this.
Check what's in curl_errno if the script isn't crashing.
Related: what is your error reporting level? If error reporting is off...why haven't you turned it on as you debug this? If error reporting is on...are you getting any errors?
Given the way you are using foreach to construct a URL, I have to wonder if you are writing a really huge URL with up to 10,000 items in your query string. If so, that's a bad approach. In a situation like that, you could consider breaking up the requests into individual queries and then use curl_multi or the Rolling Curl library that uses curl_multi to do the work to queue and execute multiple requests. (If you are just making a single request and get one gigantic response with tons of detail, this won't be useful.)
Good luck.

php cURL request to instsagram API creates page lag

I am using cURL toaccess instagrams API on a webpage I am building. THe functionality works great, however, page load is sacrificed. For instance, consider this DOM structure:
Header
Article
Instagram Photos (retrieved via cURL)
Footer
When loading the page, the footer will not load until the instagram hotos have been fully loaded with cURL. Below is the cURL function that is being called:
function fetchData($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$result = fetchData("https://api.instagram.com/v1/media/search?lat={$lat}&lng={$lng}&distance={$distance}&access_token={$accessToken}");
$result = json_decode($result);
So after this function is run, then the rest of the DOM is displayed. If I move the function call below the footer, it does not work.
Is there anything I can do to load the entire webpage and have the cURL request setn on top of the loading site (not cause a lag or holdup)?
UPDATE: Is the best solution to load it after the footer, and then append it to another area with js?
You can cache the result json into a file that is saved locally. You can make a cronjob that is called ever minute and update the locally cache file. This makes your page loading much more faster. The downside is that your cache is updating even when you don't have visitors and you have a delay of a minute in data from instagram.

Beginner at PHP - having issues with cURL

I am having some issues getting cURL to work in PHP. I'm a complete beginner (as of a few days ago) with PHP.
Basically, I'm trying to grab the output from my Arduino (which is outputting the temperature every 10 seconds) and bring it across to my web-page. The plan is to then store the data in a database of some kind so I can analyse the history/plot graphs etc over time.
Right now I just need to bring the data across though.
The Arduino is spitting out the temp, nothing else, and my router is making that available on the web here - http://2.216.137.236/
My code is as follows:
<?php
$Url = "http://2.216.137.236/";
echo "Hello, is this on?" . "<br>";
// is cURL installed?
if (!function_exists('curl_init')){
echo "cURL not installed!";
die('Sorry cURL is not installed!');
}
echo "cURL is installed!" . "<br>";
// OK cool - then let's create a new cURL resource handle
$ch = curl_init();
// Now set some options (most are optional)
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $Url);
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 1);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
print_r ($output);
?>
But right now all I am getting at my page is
"Hello, is this on?
cURL is installed!"
with no sign of the temperature anywhere (see here - http://wetdreams.org.uk/ChrisProject/curl_test.php)
(excuse the URL, kayaking website of mine)
I really hope there isn't some n00by PHP thing that is killing me.
Anyway, hope you can help me out.
Edit: My poor little router has crashed trying to serve all your requests, in hindsight probably shouldn't have put the IP up. Will reset it and try again, links might not work afterwards.
Eventually this article may help you.
The simples way would be to use file_get_contents("url") but you can of course use curl if you want.
You can use php's file_get_contents function if you only need to get what's on the page : http://php.net/manual/fr/function.file-get-contents.php
It's easier for your needs i guess.
Example :
<?php
$temperature = file_get_contents("http://2.216.137.236/");
// Process your data here
?>
I tried your code, and added this in:
echo curl_getinfo($ch, CURLINFO_HTTP_CODE);
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}
The HTTP code returns 0, and the error is: Curl error: Empty reply from server.
I can't say what's causing this, but it should help to debug further. (I can see the webpage's output for the temp in my browser - so I really can't understand why the page is not being served to Curl)

Retrieving web content multiple times simultaneously in php

I use curl to retrieve web content from another site but there is two problems;
first, it takes an average 4 sec period to retrieve the contents and I don't know if there is any way to reduce it; second, some times remote server returns a short error message instead of full content.
I was thinking it would very efficient to send 3 request simultaneously, then check the first received response to see if it's an error or not and check the second respond if the first one was an error. by this method it would not be need to wait a full 4 secs to get retry response if the first one was error. but I don't know if it's possible to doing it.
It would be very appreciated if any one write a simple code to send multiple request simultaneously.
Here is my initial code:
<?php
$then = microtime(true);
$url='http://www.example.com/StockInformationHandler.ashx?{%22Type%22:%22getstockprice%22,%22la%22:%22En%22,%22arr%22:%22IRO1LKGH0001,IRO1MADN0001,IRO1KAVR0001,IRO1BHMN0001,IRO1PNBA0001,IRO3ASPZ0001,IRO1IKCO0001,IRO1BANK0001,IRO1IKHR0001,IRO1BDAN0001,IRO1SHND0001,IRO1NBEH0001,IRO1PIAZ0001,IRO1RSAP0001,IRO3DTDZ0001,IRO1TSBE0001,IRO1NAFT0001,IRO1PKHA0001,IRO1AZAB0001,IRO3BMAZ0001,IRO1BANS0001,IRO1BAFG0001,IRO1TAYD0001,IRO1GDIR0001,IRO1SPDZ0001,IRO1NALM0001,IRO1TOSA0001,IRO1BSDR0001,IRO1ZMYD0001,IRO1SBEH0001,IRO3SMBZ0001,IRO1PASN0001,IRO1SPAH0001,IRO1PNES0001,IRO1ALIR0001,IRO1MKBT0001,IRO1FKHZ0001,IRO1RENA0001,IRO1SSHR0001,IRO1PKER0001,IRO1SAHD0001,IRO1BTEJ0001,IRO1DADE0001,IRO1PARK0001,IRO1SKRN0001,IRO1FOLD0001,IRO3KHMZ0001,IRO1NASI0001,IRO3FAYZ0001,IRO1ALMR0001,IRO1NSTH0001,IRO1BMLT0001,IRO1TKSM0001,IRO1AYEG0001,IRO1GTSH0001,IRO1COMB0001,IRO3IMFZ0001,IRO1INDM0001,IRO1DSOB0001,IRO3NPSZ0001,IRO1BPAS0001,IRO1PKOD0001,IRO1OFST0001,IRO3NOLZ0001,IRO1RIIR0001,IRO1ATDM0001,IRO1SNMA0001,IRO1VSIN0001,IRO1MNGZ0001,IRO3PSKZ0001,IRO3KRMZ0001,IRO1AMIN0001,IRO1PRDZ0001,IRO1GLOR0001,IRO1SAJN0001,IRO3BGHZ0001,IRO1PAKS0001,IRO1SIPA0001,IRO1PLKK0001,IRO1KSHJ0001,IRO3BDYZ0001,IRO1LEAB0001,IRO1KHSH0001,IRO1KRIR0001,IRO1PKLJ0001,IRO1HTOK0001,IRO1BPST0001,IRO1TAMI0001,IRO1DTIP0001,IRO1SAND0001,IRO1SHPZ0001,IRO1SHKR0001,IRO1CHAR0001,IRO1ALBZ0001,IRO1LMIR0001,IRO1TRIR0001,IRO3ETLZ0001,IRO1CRBN0001,IRO1SAKH0001,IRO3MSZ93011,IRO1NSAZ0001,IRO3BLSZ0001,IRO1MSMI0001,IRO1TMEL0001,IRO1BALB0001,IRO1LZIN0001,IRO3RFNZ0001,IRO1ABAD0001,IRO1LSMD0001,IRO1DPAK0001,IRO1PLAK0001,IRO1MAVA0001,IRO1GSBE0001,IRO3BIPZ0001,IRO1PSIR0001,IRO1BALI0001,IRO1LIRZ0001,IRO3PKSH0001,IRO1NOVN0001,IRO3GRDZ0001,IRO3PMRZ0001,IRO1ROZD0001,IRO1PABD0001,IRO1SSEP0001,IRO1SGRB0001,IRO1NSPS0001,IRO3ARFZ0001,IRO1GNBO0001,IRO1KHAZ0001,IRO1KIMI0001,IRO1SSIN0001,IRO1PETR0001,IRO1BSTE0001,IRO3DSOZ0001,IRO1TSHE0001,IRO1NMOH0001,IRO1SBAH0001,IRO1TMKH0001,IRO3MNOZ0001,IRO1MAPN0001,IRO1SGAZ0001,IRO1MAGS0001,IRO3PRZZ0001,IRO1HSHM0001,IRO3MSZ93021,IRO1KGND0001,IRO1SGOS0001,IRO1SISH0001,IRO1SKER0001,IRO1KCHI0001,IRO3MRJZ0001,IRO1FRVR0001,IRO1GHEG0001,IRO1KRTI0001,IRO1RINM0001,IRO1GHAT0001,IRO1PSHZ0001,IRO1PNTB0001,IRO1KNRZ0001,IRO1BOTA0001,IRO1GOLG0001,IRT3SATF0001,IRO3AFRZ0001,IRR3ASPZ0101,IRO7ARMP0001,IRO3ZF090001,IRT3SSAF0001,IRT3CASF0001,IRO1ASIA0001,IRO1CONT0001,IRO7BHEP0001,IRO1BAKH0001,IRO1KALZ0001,IRO1KBLI0001,IRO1TRNS0001,IRO1KTAK0001,IRO3BSMZ0001,IRR3BSMZ0101,IRO1SWIC0001,IRO1LAPS0001,IRO1JOSH0001,IRO1MOTJ0001,IRR1MOTJ0101,IRO7MILP0001,IRO1NIRO0001,IRO7BHPP0001,IRO3ZF180001,IRO1ARTA0001,IRO1IPAR0001,IRO1YASA0001,IRO1PASH0001,IRO1TAIR0001,IRO3ZF340001,IRO3ZF140001,IRO7IPTP0001,IRR7IPTP0101,IRO3ZF280001,IRO1DRKH0001,IRO3ZF040001,IRO7SHIP0001,IRO1BARZ0001,IRO1PLST0001,IRO1GAZL0001,IRO1PTAP0001,IRO7HPKP0001,IRO1PIRN0001,IRO7GSIP0001,IRO1MOZI0001,IRO3MSZ93031,IRO3MSZ93041,IRO3MSZ93051,IRO3MSZ93061,IRO3MSZ93071,IRO3MSZ93081,IRO3MSZ93091,IRO3MSZ93101,IRO3MSZ93111,IRO3MSZ93121,IRO3MSZ94011,IRO3MSZ94021,IRO3MSZ94031,IRO3MSZ94041,IRO3MSZ94051,IRO1FROZ0001,IRO1GSKE0001,IRO7NARP0001,IRO1TKNO0001,IRO1MNMH0001,IRO3TORZ0001,IRO1SESF0001,IRO3PMTZ0001,IRO1PMSZ0001,IRO3OSHZ0001,IRO3SGDZ0001,IRO3CGRZ0001,IRO1OFRS0001,IRO1MSKN0001,IRO3PJMZ0001,IRO7BPRP0001,IRO1FIBR0001,IRO1KMSH0001,IRO1KSKA0001,IRO3ZF160001,IRO1NEOP0001,IRO1HJPT0001,IRO3KHZZ0001,IRO7RAHP0001,IRO1HFRS0001,IRO1KFJR0001,IRO7BHKP0001,IRO1AZIN0001,IRO1ATIR0001,IRO1SZPO0001,IRO1RTIR0001,IRO1RADI0001,IRR1CHAR0101,IRO3ZF030001,IRO1FNAR0001,IRO7SDRP0001,IRO1IDOC0001,IRO1KFAN0001,IRO1GOST0001,IRO1LENT0001,IRO1MHKM0001,IRO1MSTI0001,IRO1MNSR0001,IRR1IKCO0101,IRO1MESI0001,IRO1DABO0001,IRO1DOSE0001,IRO1DALZ0001,IRO1PDRO0001,IRO1TMVD0001,IRO1THDR0001,IRO1DJBR0001,IRO7DHVP0001,IRO1DAML0001,IRO1DRZK0001,IRO1DZAH0001,IRO1DSIN0001,IRO1DDPK0001,IRO1ABDI0001,IRO1DFRB0001,IRO1FTIR0001,IRO1DKSR0001,IRO1EXIR0001,IRO1DLGM0001,IRO7PDHP0001,IRO1IRDR0001,IRO3ZOBZ0001,IRO1INFO0001,IRO1EPRS0001,IRO1TKIN0001,IRO1RKSH0001,IRO3ZF120001,IRO3ZF240001,IRO3PZGZ0001,IRO7ZNJP0001,IRO3ZAGZ0001,IRO1AZRT0001,IRO1SDAB0001,IRO1SADB0001,IRO1SURO0001,IRO7IRNP0001,IRO7CBBP0001,IRO1SBOJ0001,IRO3SBZZ0001,IRO1SBHN0001,IRO1PRMT0001,IRO1STEH0001,IRO7SASP0001,IRO1SKHS0001,IRO1SKAZ0001,IRO7SEKP0001,IRO3DBRZ0001,IRO1SDST0001,IRO1SDOR0001,IRO1SROD0001,IRR1SSHR0101,IRO1SIMS0001,IRO1SEFH0001,IRO1SSOF0001,IRB3SSHZ9241,IRO1SFRS0001,IRO1SFKZ0001,IRO1FRDO0001,IRO1SFAS0001,IRO1SFNO0001,IRO1SGEN0001,IRO3SKBZ0001,IRO1SKOR0001,IRO1SMAZ0001,IRO3IBKZ0001,IRO7IENP0001,IRO1SSNR0001,IRO1SHZG0001,IRO1SHGN0001,IRO3SYSZ0001,IRO1SEIL0001,IRO1AMLH0001,IRO3PNLZ0001,IRO1BMPS0001,IRO1PPAM0001,IRO3PTRZ0001,IRO1THSH0001,IRO1TOPI0001,IRO1DODE0001,IRO1SHRG0001,IRO1ZNGN0001,IRO1SEPP0001,IRO7STNP0001,IRO1TSAL0001,IRO1SHSI0001,IRO1PESF0001,IRO1PFRB0001,IRO1SHFS0001,IRR1SHFS0101,IRO1PFAN0001,IRO7PKBP0001,IRO1KAFF0001,IRO1NKOL0001,IRO7SHLP0001,IRO1NPRS0001,IRO1VASH0001,IRT1CSNF0001,IRO1KLBR0001,IRO1BENN0001,IRO1LPAK0001,IRO1MINO0001,IRO1CHCH0001,IRO1KDPS0001,IRO1DMOR0001,IRO1SLMN0001,IRO1SPKH0001,IRO1SPPE0001,IRO1SHAD0001,IRO7MINP0001,IRO1GORJ0001,IRO1GCOZ0001,IRO1MRGN0001,IRO1MRAM0001,IRO1RNAB0001,IRO1NOSH0001,IRO1KIVN0001,IRO1MARK0001,IRO1KSIM0001,IRO1ALTK0001,IRO1SAMA0001,IRO1BAHN0001,IRO1BMAS0001,IRO1BIRI0001,IRO1SPTA0001,IRO1JAMD0001,IRO1FAJR0001,IRO1JSHO0001,IRO1FKAS0001,IRO1FRIS0001,IRO1TFKR0001,IRO3ZF100001,IRO3KZIZ0001,IRO1SEPA0001,IRO1LSDD0001,IRO1SORB0001,IRO1SOLI0001,IRO1LAMI0001,IRO7FANP0001,IRO1NGFO0001,IRO1FVAN0001,IRO1FAIR0001,IRO1GPRS0001,IRO1GPSH0001,IRO3CHRZ0001,IRO1GGAZ0001,IRO1GSHI0001,IRO1GHND0001,IRO3GHSZ0001,IRO1GESF0001,IRO1GMRO0001,IRO1GNJN0001,IRO1ABGN0001,IRO3ZF200001,IRT3SSKF0001,IRO7PKZP0001,IRO1KESF0001,IRO1BAMA0001,IRO1ITAL0001,IRO1IRGC0001,IRO1KPRS0001,IRO1CHML0001,IRO1CHIR0001,IRO1KHFZ0001,IRO1DMVN0001,IRO1TSRZ0001,IRO1ROOI0001,IRO1SINA0001,IRR1SINA0101,IRO1ARDK0001,IRO1PSER0001,IRO1KSAD0001,IRO3KSGZ0001,IRO1TBAS0001,IRO1SHQZ0001,IRO1ALVN0001,IRO1NILO0001,IRO1BHSM0001,IRO1SHMD0001,IRO1VARZ0001,IRO3KBCZ0001,IRO1ASAL0001,IRO1AZMA0001,IRO1PELC0001,IRO1PYAM0001,IRO1JJNM0001,IRO1LKPS0001,IRO1SRMA0001,IRO1KMOA0001,IRO1IAGM0001,IRO3KARZ0001,IRO1BMEL0001,IRO7PMMP0001,IRO3ZF220001,IRR3KHMZ0101,IRO3MIHZ0001,IRO1BROJ0001,IRO1PTOS0001,IRO3ZF060001,IRO1MRIN0001,IRO7BNOP0001,IRO7NIRP0001,IRO3ZF080001,IRO1HMRZ0001,IRO7VHYP0001,IRR1ALBZ0101,IRO1OIMC0001,IRO1TAZB0001,IRO7KARP0001,IRO1BIME0001,IRO1BPAR0001,IRO1DARO0001,IRO1TGOS0001,IRO1TOKA0001,IRO3BKHZ0001,IRO3BMDZ0001,IRO3ZMNZ0001,IRO1SSAP0001,IRO1SDID0001,IRO1SKBV0001,IRR1SKBV0101,IRO7SNAP0001,IRO7SHOP0001,IRO1GBEH0001,IRO7TKDP0001,IRO1KRAF0001,IRO7KOSP0001,IRO3IRNZ0001,IRO7BVMP0001,IRO1MELT0001,IRO1GMEL0001,IRO1SNRO0001,IRO1NIKI0001,IRR3ETLZ0101,IRR1BARZ0101,IRO1KVRZ0001,IRR1TRIR0101,IRR3ZNDZ0101,IRR3ZNDZ0101,IRR1KSKA0101,IRR1DALZ0101,IRO3BLKZ0001,IRR1TKIN0101,IRO1KHOC0001,IRO1CIDC0001,IRR1PNTB0101,IRR1PRDZ0101,IRR3PTRZ0101,IRO3LIAZ0001,IRR1GNJN0101,IRO3TBSZ0001,IRR1PKER0101,IRR1SGAZ0101,IRO1BVMA0001,IRO1MOBN0001,IRR1BMEL0101,IRO3FOHZ0001,IRR1BPAS0101,IRO3BHLZ0001,,%22}';
$ch=curl_init();
$timeout=15;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Get URL content
$lines_string=curl_exec($ch);
curl_close($ch);
$now = microtime(true);
echo sprintf("Elapsed: %f", $now-$then);
$lines_string;
echo "\r\n";
?>

Categories