Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F15164204
parse.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Unknown
Size
561 B
Referenced Files
None
Subscribers
None
parse.php
View Options
#!/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
Details
Attached
Mime Type
text/x-php
Expires
Wed, Nov 18, 22:39 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262971
Default Alt Text
parse.php (561 B)
Attached To
Mode
R24 Wikimedia Valerio_Bozzolan_bot tasks
Attached
Detach File
Event Timeline