This commit is contained in:
Valeria Fadeeva 2023-12-10 01:04:31 +05:00
parent 3d392c7fc7
commit 35e5f000f3
3 changed files with 34 additions and 1 deletions

28
public/assets/js/toot.js Normal file
View File

@ -0,0 +1,28 @@
const log = document.getElementById('log');
log.innerHTML = "";
async function fetchData() {
var serverAddress = "techhub.social";
const response = await fetch(`https://${serverAddress}/api/v1/accounts/111518136987654656/statuses`);
const data = await response.json();
data.forEach(obj => {
Object.entries(obj).forEach(([key, value]) => {
if (key == "id") {
log.innerHTML = log.innerHTML + `<iframe src="https://techhub.social/@Melawy/${value}/embed" class="mastodon-embed" style="max-width: 100%; border: 0" height="100%" width="60%" allowfullscreen="allowfullscreen"></iframe>` + '<br>';
}
});
log.innerHTML = log.innerHTML + '<br>';
});
}
function openInNewTab(url) {
window.open(url, '_blank').focus();
}
document.addEventListener("DOMContentLoaded", fetchData);

View File

@ -275,7 +275,9 @@
<script src="node_modules/@fortawesome/fontawesome-free/js/all.min.js"></script> <script src="node_modules/@fortawesome/fontawesome-free/js/all.min.js"></script>
<script src="assets/js/script.js"></script> <script src="https://techhub.social/embed.js" async="async"></script>
<script type="module" src="assets/js/script.js"></script>
<script> <script>

View File

@ -173,6 +173,9 @@
</ul> </ul>
</article> </article>
<div id="log"></div>
<script type="module" src="assets/js/toot.js"></script>
<!-- <!--
<nav class="blog-pagination" aria-label="Pagination"> <nav class="blog-pagination" aria-label="Pagination">
<a class="btn btn-outline-primary rounded-pill" href="#">Older</a> <a class="btn btn-outline-primary rounded-pill" href="#">Older</a>