- <?php
- $handle = fopen("postcodes.txt", "r");
- if ($handle) {
- while (($postcode = fgets($handle)) !== false) {
- $postcode = trim($postcode);
- if (empty($postcode)) continue;
- $ch = curl_init();
- $url = "http://www.dslchecker.bt.com/pls/adsl/ADSLChecker.AddressOutput?URL=&SP_NAME=a%20service%20provider&postcode=$postcode&VERSION=29&MS=E&CAP=yes&AEA=N";
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- $result = curl_exec($ch);
- curl_close ($ch);
- $dom = new DOMDocument();
- @$dom->loadHTML($result);
- $finder = new DomXPath($dom);
- $nodes = $finder->query("//option");
- foreach ($nodes as $node) {
- echo $node->nodeValue."\r\n";
- }
- }
- }
- ?>
Untitled
Posted by Anonymous on Sun 13th Apr 2014 05:23
raw | new post
view followups (newest first): Untitled by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
kpaste.net RSS