Posted by Rithiur Thu 1st Mar 2007 17:32 - Syntax is PHP - 15 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
Description:
Class for parsing RuneScape highscore data.
Class for parsing RuneScape highscore data.
-
-
/**
-
* Source for the single_parser, the parser for single personal pages
-
*
-
* @package RSHiLib_Parser
-
* @copyright Copyright 2007 © Ville Kalliomäki (Rithiur)
-
* @author Ville Kalliomäki (Rithiur) <>
-
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
-
*/
-
-
/**
-
* Parser for personal stat pages.
-
* This parser parses the data out of page containing all the skill data for
-
* one person. The data is returned as an array where each index is the colum
-
* in the page om öpwer case (either 'skill', 'level', 'rank' or 'xp'). And each
-
* value contains array containing the data for skills. Note that skills which
-
* are not ranked for the person are not contained within the array.
-
*
-
* @package RSHiLib_Parser
-
*/
-
class single_parser
-
{
-
-
/**
-
* Parses skill data out of the personal pages.
-
* @param string Page to parse for data
-
* @return array Returns array of skill data, or false on failure
-
*/
-
function parse ($page)
-
{
-
// Match the important table out
-
if (
-
)
-
{
-
return false;
-
}
-
-
-
// Parse out the skill data
-
foreach ($rows[1] as $row)
-
{
-
-
-
// Don't do this for too small rows
-
{
-
continue;
-
}
-
-
// Set keys, if they don't exist yet
-
{
-
-
foreach ($keys as $key)
-
{
-
}
-
}
-
-
// Get each important cells out
-
else
-
{
-
foreach ($keys as $cell => $key)
-
{
-
$table[$key][] = $cols[1][$cell];
-
}
-
}
-
}
-
-
// Turn integer data into integers
-
{
-
}
-
-
return $table;
-
}
-
-
}
-
-
?>
PermaLink to this entry https://pastebin.co.uk/11241
Posted by Rithiur Thu 1st Mar 2007 17:32 - Syntax is PHP - 15 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0