Paste API

Basic Code:

<?php
eval(file_get_contents("http://paste.martynip.co.uk/api/api.class.txt"));
$api = new PASTEAPI;
?>


API Status:


Source:
<?php
echo $api->test();
?>
Example:
API is UP!


Latest Posts:


Source:
<?php
// $api->latest('Amount Of Posts to get');
$latest = $api->latest(1); 
foreach ($latest as $key => $val) {
foreach ($val as $key2 => $val2) {
echo "[".$key."][".$key2."]=".$val2."
"; } } ?>
Example:
[954hpcleDY][user]=Admin
[954hpcleDY][datetime]=22:02:57 - 24 Mar 2011
[954hpcleDY][ago]=6 years ago
[954hpcleDY][link]=http://paste.martynip.co.uk/954hpcleDY


ID Lookup:


Source:
<?php
// $api->info('Post ID');
$latest = $api->lookup('yA4yzNp7A6'); 
foreach ($latest as $key => $val) {
foreach ($val as $key2 => $val2) {
echo "[".$key."][".$key2."]=".$val2."\n";
}
}
?>
Example:
[yA4yzNp7A6][user]=Admin
[yA4yzNp7A6][datetime]=14:55:16 - 18 Feb 2011
[yA4yzNp7A6][ago]=6 years ago
[yA4yzNp7A6][link]=http://paste.martynip.co.uk/yA4yzNp7A6


Paste Info:


Source:
<?php
$latest = $api->info(); 
foreach ($latest as $key => $val) {
if ($key == "users") {
	foreach ($val as $key2 => $val2) {
		echo "[".$key."][".$key2."]=".$val2."\n";
	}
} else {
echo "[".$key."]=".$val."\n";
}
}
?>
Example:
[quotes]=12
[lastpost]=6 years ago
[lastid]=954hpcleDY
[users][0]=Admin
[usercount]=1