[b]Facepunch Wrapper[/b]
This is my new, and improved facepunch wrapper, you can do a bunch of cool stuff with it! Such as getting a Facepunch users username, their post data and more! You can even get ratings from posts and you can even get the users current membership on the site, be it gold, developer or moderator. It has been redesigned for composer, and is now easier than ever to install.
[b] Downloads [/b]
[URL="https://github.com/KunkeropStudios/Facepunch"]Git[/URL]
[URL="https://packagist.org/packages/kunkeropstudios/facepunch"]Composer[/url]
[b] Documentation [/b]
You will need to include this library using composer, after you are done with that, you first have to include the autoloader, I'm going to assume you know how to use composer.
[code]
use Facepunch\Facepunch as FacepunchController;
class ExampleClass{
protected $facepunch
public function __construct(){
$this->facepunch = new FacepunchController;
}
public function getUsername( $userid ){
$this->facepunch->setUserID( $userid );
if( !$this->facepunch->isUserValid() )
return false;
return $this->facepunch->getUsername();
}
}
[/code]
Now, you can create that class and echo it out. You don't need to use a class but I'm just it for this demonstration.
[code]
$example = new ExampleClass();
echo $example->getUsername( '1' );
[/code]
You may also extend the class.
[code]
class ExampleClass extends Facepunch{
public function __construct(){
//Could do stuff here
}
public function findSpecificComment( $prefix, $comment ){
if( !$this->isUserValid() )
return false;
return ( $this->compareComments( $prefix.$comment ) ) ? true : false;
}
}
$test = new ExampleClass();
$test->setUserID( 'test' );
if( $test->isUserValid() ){
if( $test->findSpecificComment("CP:", "penisface"))
return true;
}
[/code]
Thanks, and let me know if you want any additions!
Looks really nice! Would love to make a small project with it!
can't download Error (404) dropbox
[QUOTE=frietje2008;47955222]can't download Error (404) dropbox[/QUOTE]
fixed, was changing it around.
Should have made it in Haskell :D
Good job!
[QUOTE=Darwin226;47967295]Should have made it in Haskell :D
Good job![/QUOTE]
Rewrite in Haskell soon, promise! ( I need to relearn it anyway ).
Sorry, you need to Log In to post a reply to this thread.