first commit
This commit is contained in:
95
kalsport-pl/xml-convert.php
Normal file
95
kalsport-pl/xml-convert.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?
|
||||
$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_8.xml' );
|
||||
$xml = new SimpleXMLElement( $file );
|
||||
|
||||
foreach ($xml->xpath('//item/*[
|
||||
not(
|
||||
name() = "g:id"
|
||||
or name() = "g:title"
|
||||
)
|
||||
]') as $child) unset($child[0]);
|
||||
|
||||
$label_name = 'g:custom_label_0';
|
||||
|
||||
for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ )
|
||||
{
|
||||
$xml -> channel -> item[$i] -> $label_name = 'pilki-do-kosza';
|
||||
}
|
||||
$xml -> asXml( 'pilki-do-kosza.xml' );
|
||||
echo '<p>wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-do-kosza.xml</p>';
|
||||
|
||||
$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_9.xml' );
|
||||
$xml = new SimpleXMLElement( $file );
|
||||
|
||||
foreach ($xml->xpath('//item/*[
|
||||
not(
|
||||
name() = "g:id"
|
||||
or name() = "g:title"
|
||||
)
|
||||
]') as $child) unset($child[0]);
|
||||
|
||||
$label_name = 'g:custom_label_0';
|
||||
|
||||
for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ )
|
||||
{
|
||||
$xml -> channel -> item[$i] -> $label_name = 'pilki-lekarskie';
|
||||
}
|
||||
$xml -> asXml( 'pilki-lekarskie.xml' );
|
||||
echo '<p>wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-lekarskie.xml</p>';
|
||||
|
||||
$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_10.xml' );
|
||||
$xml = new SimpleXMLElement( $file );
|
||||
|
||||
foreach ($xml->xpath('//item/*[
|
||||
not(
|
||||
name() = "g:id"
|
||||
or name() = "g:title"
|
||||
)
|
||||
]') as $child) unset($child[0]);
|
||||
|
||||
$label_name = 'g:custom_label_0';
|
||||
|
||||
for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ )
|
||||
{
|
||||
$xml -> channel -> item[$i] -> $label_name = 'pilki-nozne';
|
||||
}
|
||||
$xml -> asXml( 'pilki-nozne.xml' );
|
||||
echo '<p>wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-nozne.xml</p>';
|
||||
|
||||
$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_11.xml' );
|
||||
$xml = new SimpleXMLElement( $file );
|
||||
|
||||
foreach ($xml->xpath('//item/*[
|
||||
not(
|
||||
name() = "g:id"
|
||||
or name() = "g:title"
|
||||
)
|
||||
]') as $child) unset($child[0]);
|
||||
|
||||
$label_name = 'g:custom_label_0';
|
||||
|
||||
for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ )
|
||||
{
|
||||
$xml -> channel -> item[$i] -> $label_name = 'pilki-reczne';
|
||||
}
|
||||
$xml -> asXml( 'pilki-reczne.xml' );
|
||||
echo '<p>wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-reczne.xml</p>';
|
||||
|
||||
$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_12.xml' );
|
||||
$xml = new SimpleXMLElement( $file );
|
||||
|
||||
foreach ($xml->xpath('//item/*[
|
||||
not(
|
||||
name() = "g:id"
|
||||
or name() = "g:title"
|
||||
)
|
||||
]') as $child) unset($child[0]);
|
||||
|
||||
$label_name = 'g:custom_label_0';
|
||||
|
||||
for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ )
|
||||
{
|
||||
$xml -> channel -> item[$i] -> $label_name = 'pilki-siatkowe';
|
||||
}
|
||||
$xml -> asXml( 'pilki-siatkowe.xml' );
|
||||
echo '<p>wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-siatkowe.xml</p>';
|
||||
Reference in New Issue
Block a user