Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect("mysql.tndls.tk","ravonus","");
- // Check connection
- if(! $con )
- {
- echo "Failed to connect to MySQL: " . mysql_error();
- }
- $urls = array();
- $DomDocument = new DOMDocument();
- $DomDocument->preserveWhiteSpace = false;
- $DomDocument->load('http://xivdb.com/sitemap/?item/sitemap.xml');
- $DomNodeList = $DomDocument->getElementsByTagName('loc');
- foreach($DomNodeList as $url) {
- $urls[] = $url->nodeValue;
- }
- foreach($urls as $url) {
- $url = str_replace('http://xivdb.com/?item/', '', $url);
- $item = split('/', $url);
- $item1 = mysql_real_escape_string($item['1']);
- $item2 = mysql_real_escape_string($item['0']);
- //var_dump($item);
- //store $item[0] and $item[1] to db in the proper cols
- //echo ($item['1']);
- //echo ($item['0']);
- //$name = ($item['1']);
- //$id = ($item['0']);
- mysql_query($sql, $con);
- mysql_select_db( 'ff14' );
- $name = mysql_real_escape_string($name);
- $sql="INSERT INTO `tooltips` (Name, ID)
- VALUES ('$item1', '$item2')";
- echo ($item['0']);
- echo ($item['1']);
- }
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement