Page MenuHomeGitPull.it

parse.php
No OneTemporary

Authored By
Unknown
Size
561 B
Referenced Files
None
Subscribers
None

parse.php

#!/usr/bin/php
<?php
/*****************************
* Lega Serie A IDs finder *
* *
* @author Valerio Bozzolan *
* @license GNU GPL v3+ *
*****************************/
// Giving an HTTP page from stdin, it generates a CSV in stdout
$stdin = file_get_contents( 'php://stdin' );
// find a link
preg_match_all( '#/giocatori/([a-zA-Z-]+)/([a-zA-Z0-9-]+)#', $stdin, $matches, PREG_PATTERN_ORDER );
$n = count( $matches[ 0 ] );
for( $i = 0; $i < $n; $i++ ) {
echo $matches[ 2 ][ $i ] . ',' . $matches[ 1 ][ $i ] . "\n";
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Nov 18, 22:39 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262971
Default Alt Text
parse.php (561 B)

Event Timeline