Skip to content

Instantly share code, notes, and snippets.

@PeterJuel
Created December 29, 2012 20:15
Show Gist options
  • Save PeterJuel/4409132 to your computer and use it in GitHub Desktop.
Save PeterJuel/4409132 to your computer and use it in GitHub Desktop.
<form action="" method="get">
<!-- search from -->
<div class="label">
<label for="suche.searchFrom">Tender from</label>
</div>
<div class="value">
<input id="suche.searchFrom" name="dato" value="10/03/2012" class="datepicker" type="text" />
</div>
<!-- produktart selection -->
<div class="label">
<label for="suche.produktartSelection">Productkind</label>
</div>
<div class="value">
<input name="produkt" value ='1' > (1=Primärregelleistung, 2=Sekundärregelleistung, 3=Minutenreserveleistung)
</div>
<!-- limits -->
<div class="label">
<label for="suche.resultLimit">next</label>
</div>
<div class="value">
<input name="limit" value ='100' >
</div>
<!-- button -->
<input name="submit" value='ok' class="navButtonSmall buttonLeft" type="submit" />
</form>
<?php
if(isset($_GET["dato"])){
$ch = curl_init('https://www.regelleistung.net/ip/action/ausschreibung/public/ip/action/ausschreibung/public');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('suche.searchFrom' => $_GET["dato"], 'suche.resultLimit'=>$_GET["limit"],'suche.produktartSelection' => $_GET["produkt"]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$regex='|<a.*?href="(.*?)"|';
preg_match_all($regex,$response,$parts);
$links=$parts[1];
// Pick only download links
foreach($links as $link){
if (strpos($link,'download') !== false) {
$dwlink[] = " https://www.regelleistung.net".$link."<br><br>";
}
}
unset($dwlink[0]); // Remove "List of tenders" download
foreach($dwlink as $index=>$link){
echo $link;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment