mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
47 lines
2.5 KiB
Text
47 lines
2.5 KiB
Text
<div class="content single-Col">
|
|
|
|
<h2 class="alpha">NeoCities Developers API</h2>
|
|
|
|
<p><img src="/assets/img/cat-larger.png"></p>
|
|
|
|
<p>
|
|
<strong>Our Developers API allows you to make changes to your site remotely with programming languages!</strong>
|
|
</p>
|
|
<h3>Ideas</h3>
|
|
<p>
|
|
<ul>
|
|
<li>Create your own blog, and use a script to add new blog posts.</li>
|
|
<li>Integrate external HTML editors / upload tools.</li>
|
|
<li>Provide updated air quality information from a gauge at your house.</li>
|
|
<li>Conduct regular backups of your site.</li>
|
|
</ul>
|
|
</p>
|
|
|
|
<h3>Rules</h3>
|
|
<p>
|
|
<ul>
|
|
<li>Do not spam the server with tons of API requests.</li>
|
|
<li>Try to limit site updates to one per minute.</li>
|
|
<li>Do not use the API to "game" the site (increase ranking by manipulating our algorithms).</li>
|
|
<li>Do not use the API to data mine / rip all of the sites.</li>
|
|
</ul>
|
|
</p>
|
|
|
|
<h2>API Documentation</h2>
|
|
<p>
|
|
The NeoCities API is a <a href="http://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank">REST</a> API, which uses query parameters for input, and returns data in the <a href="http://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> format (except for file downloads). It uses client-side <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">HTTP AUTH</a> to authenticate, using your user/site name and password as the credentials. It is designed to play nicely with the most common HTTP libraries available in programming languages, and can be easily used with <strong>cURL</strong> (a command-line tool for making HTTP requests you can use by opening a terminal on your computer).
|
|
</p>
|
|
<p>
|
|
<strong>That's a lot of buzz words if you're new to programming.</strong> Don't worry, it's easier than it sounds! We'll walk you through some working examples you can get started with.
|
|
</p>
|
|
|
|
<h3>POST /api/upload</h3>
|
|
<p>
|
|
Uploads files to your site. You can upload as many files as you want with a single query, as long as the entire request stays within the disk space limit. The parameter name should be the name of the file, with the extension so we know what kind of file it is (index<strong>.html</strong>).
|
|
</p>
|
|
|
|
<h4>Examples</h4>
|
|
<p>Using cURL to upload a single local file (<strong>local.html</strong>), which will be <strong>index.html</strong> on the server:</p>
|
|
<code>$ curl -F index.html=@local.html https://USER:PASS@neocities.org/api/upload</code>
|
|
|
|
</div> <!-- end .content -->
|