PHP code example of reed-jones / neocities

1. Go to this page and download the library: Download reed-jones/neocities library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

reed-jones / neocities example snippets


// First we s\Neocities\Neocities;

// Then we log in using either username/password or api key

$neocities = new Neocities([
    'username' => 'YOUR_USERNAME',
    'password' => 'YOUR_PASSWORD'
]);

// or

$neocities = new Neocities([
    'apiKey' => 'YOUR_API_KEY'
]);

$result = $neocities->upload([
    'hello.html' => './local.html',
    'about.html' => './AboutMe.html'
]);

var_dump($result);

$result = $neocities->delete([
    'hello.html',
    'about.html'
]);

var_dump($result);

$result = $neocities->list();

var_dump($result);

$result = $neocities->info();

var_dump($result);

$result = $neocities->key();

var_dump($result);

// bootstrap.php
Jigsaw::mixin(new \ReedJones\Neocities\NeocitiesDeployment($container));

// Programmatic API Usage
$events->afterBuild(function (Jigsaw $jigsaw) {
    if ($jigsaw->getEnvironment() === 'production') {
        // Automatic deployment after all production builds
        $jigsaw->deployToNeocities();
    }
});