1
0
mirror of https://gitlab.com/2-chainz/2chainz.git synced 2025-06-15 17:36:39 +00:00
2chainz/website/index.html

242 lines
7.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
<link rel="stylesheet" href="css/mvp.css" />
<title>2chainz.ansonbiggs.com</title>
<meta name="description" content="A REST API for 2 Chainz Quotes." />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="2 Chainz Rest API" />
<meta property="og:url" content="https://2chainz.ansonbiggs.com" />
<meta
property="og:description"
content="A free REST API for 2 Chainz quotes"
/>
<style>
* {
transition: all 0.2s ease-out; /* Thanks https://news.ycombinator.com/item?id=19594993 */
}
body {
background-color: #d9c06e;
color: #03252a;
}
hr {
background-color: #03252a;
}
section aside {
border: 1px solid black;
box-shadow: none;
}
nav {
margin-bottom: 2rem;
}
:root {
--color: darkviolet;
--color-bg-secondary: black;
--color-link: darkviolet;
}
</style>
</head>
<body>
<header style="height: 90vh">
<nav>
<a href="https://2chainz.ansonbiggs.com">2chainz.ansonbiggs.com</a>
<p>A REST API for 2 Chainz Quotes</p>
<a href="https://gitlab.com/2-chainz/2chainz">Source Code</a>
</nav>
<section style="height: 50vh">
<blockquote style="margin: auto">
<span id="quote">TRUUUUUUUU</span>
<footer><i id="alias">- 2 Chainz</i></footer>
</blockquote>
</section>
<section>
<a onclick="getQuote()" href="#"
><b style="width: 20vw">
<ion-icon size="large" name="refresh-circle"></ion-icon>
<span style="display: grid; place-items: center">New Quote</span>
</b>
</a>
</section>
<a href="#scroll" id="scroll-icon" style="padding-top: 10vh"
><ion-icon size="large" name="arrow-down-sharp"></ion-icon
></a>
</header>
<main>
<hr style="padding-top: 0" />
<header id="scroll">
<h2>Usage</h2>
<p>
For exhaustive and up to date documentation see
<a href="/docs">/docs</a>
</p>
</header>
<details open>
<summary>Quote</summary>
<p>
Returns a random 2 Chainz Quote in <code>json</code> format like the
following example:
</p>
<p>
send a <code>get</code> request to
<code
><a href="https://2chainz.ansonbiggs.com/api/quote"
>https://2chainz.ansonbiggs.com/api/quote</a
></code
>
</p>
<pre><code>{
"quote": "I got a pocket full of money, it got me walking all slew-foot"
}</code></pre>
</details>
<details>
<summary>Alias</summary>
<p>
Returns a random 2 Chainz alias in <code>json</code> format. The
return values are weighted and a full list can be seen in
<a
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/alias/aliases.py"
>aliases.py</a
>.
</p>
<p>
send a <code>get</code> request to
<code
><a href="https://2chainz.ansonbiggs.com/api/alias"
>https://2chainz.ansonbiggs.com/api/alias</a
></code
>
</p>
<pre><code>{
"alias": "Dos Cadenas"
}</code></pre>
</details>
<hr />
<section>
<header>
<h2>
Projects built using 2chainz.ansonbiggs.com (Your project could be
here!)
</h2>
</header>
<aside>
<h3>
<a href="https://t.me/twoChainzBot">Telegram Bot</a>
</h3>
<p>
An inline Telegram bot that sends a random 2 Chainz Quote. Hosted on
a
<a href="https://m.do.co/c/6b5df7ef55b6">DigitalOcean</a> Kubernetes
Cluster.
</p>
<small
><a href="https://gitlab.com/2-chainz/2-chainz-telegram"
>Source Code</a
>
</small>
</aside>
<aside>
<h3>
<a href="https://twitter.com/bot_chainz">Twitter Bot</a>
</h3>
<p>
A Twitter bot that posts weekly 2 Chainz Quotes. Built with Azure
Serverless Functions and Python.
</p>
<small
><a href="https://gitlab.com/2-chainz/2-chainz-twitter-bot"
>Source Code</a
>
</small>
</aside>
</section>
<hr />
<section>
<header>
<h2>Frequently Asked Questions</h2>
</header>
<aside>
<h3>Can I use this?</h3>
<p>
Please do! This project uses a
<a href="https://tldrlegal.com/license/mit-license#summary"
>MIT License</a
>
which means your welcome to do whatever you want.
</p>
<p>
<small
><a href="https://ansonbiggs.com/#connect"
>Please let me know if you use it though!</a
></small
>
</p>
</aside>
<aside>
<h3>Do I need an API key or is this API rate limited?</h3>
<p>
No, the API is totally free and unlimited. However, its being hosted
on a tiny machine that is overburdened by docker containers.
</p>
</aside>
<aside>
<h3>Is this project open source? Can I contribute?</h3>
<p>
Yes and Yes! Check out the
<a href="https://gitlab.com/2-chainz/2chainz">Project on GitLab.</a>
</p>
</aside>
<aside>
<h3>Does 2 Chainz know about this?</h3>
<p>Probably not.</p>
</aside>
<aside>
<h3>Why?</h3>
<p>Because 2 Chainz has some of the best lines in the rap game.</p>
</aside>
</section>
</main>
<footer>
<hr />
<p>Made by <a href="https://ansonbiggs.com">Anson</a></p>
<p>Inspired By <a href="https://kanye.rest/">kanye.rest</a>.</p>
<p><small>Truuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu</small></p>
</footer>
<script>
getQuote();
function getQuote() {
fetch("/api/quote", { method: "GET" })
.then((resp) => resp.json())
.then(function (data) {
document.getElementById("quote").innerHTML = data.quote;
});
fetch("/api/alias", { method: "GET" })
.then((resp) => resp.json())
.then(function (data) {
document.getElementById("alias").innerHTML = "- " + data.alias;
});
}
</script>
<script
type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"
></script>
</body>
</html>