Update API
parent
3ede671118
commit
3f8ca2de48
1 changed files with 10 additions and 1 deletions
11
API.md
11
API.md
|
@ -18,6 +18,15 @@ To use the API you can use Ox.App if you use Ox.js, or look at [pandora_client](
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
float: left;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
async function api(action, data) {
|
async function api(action, data) {
|
||||||
const url = "https://pad.ma/api/"
|
const url = "https://pad.ma/api/"
|
||||||
|
@ -46,7 +55,7 @@ To use the API you can use Ox.App if you use Ox.js, or look at [pandora_client](
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
result.data.items.forEach(item => {
|
result.data.items.forEach(item => {
|
||||||
const div = document.createElement("div")
|
const div = document.createElement("div")
|
||||||
div.innerHTML = `<h1><a href="https://pad.ma/${item.id}">${item.title}</a></h1><p>${item.summary}</p>`
|
div.innerHTML = `<h1><a href="https://pad.ma/${item.id}">${item.title}</a></h1><p><img src="https://pad.ma/${item.id}/128p.jpg">${item.summary}</p>`
|
||||||
document.body.appendChild(div)
|
document.body.appendChild(div)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue