added twtxt_template.txt and fixed typos in readme

This commit is contained in:
sørenpeter 2024-04-26 11:39:53 +02:00
parent 8019a665b4
commit ca488e686d
9 changed files with 125 additions and 8 deletions

4
.gitignore vendored
View file

@ -5,8 +5,8 @@ Thumbs.db
*.DS_Store
*.txt
!twtxt_template.txt
custom.css
private/cache/*
!private/cache/.gitkeep
private/config.ini
error_log
custom.css
error_log

View file

@ -4,7 +4,7 @@ Created by sørenpeter (www.darch.dk)
So are you also tired of having to use big tech's social medias to stay connected with friends and interesting people, and having your privacy pried upon?
And are you a creative human, who want back control over you art, music, words, code, instead of having to shoehorn your soul into the grid of blackbox algoritmes?
And are you a creative human, who want back control over you art, music, words, code, instead of having to shoehorn your soul into the grid of blackbox algorithms ?
Then it is you, who I've made timeline for.
@ -13,12 +13,14 @@ Then it is you, who I've made timeline for.
timeline is a handfull of small files that you upload to a server and access it via a browser.
It then gives you an interface for posting words, links (and images too, soon), as well as following other peoples feeds and enganging in conversations by posting replies.
For the social features timeline are using the [twtxt](https://twtxt.readthedocs.io) format and most of the [Twtxt Extensions](https://dev.twtxt.net) developed in the context of [Yarn.social](https://yarn.social/).
For the social features timeline are using the [twtxt](https://twtxt.readthedocs.io) format and most of the twtxt Extensions developed in the context of Yarn.social](https://yarn.social/).
timeline also support its own flavour of webmentions, so it is posible to be notified about `@mentions` from feeds you are not currenly/yet following.
timeline also support its own flavor of WebMentions, so it is possible to be notified about `@mentions` from feeds you are not currently/yet following. You can also search for others feeds using WebFinger, if they got that set up on their server , like it's the case for most yarn.social pods.
You can also search for others feeds using [WebFinger](https://webfinger.net/), if they got that set up on their servser, like it's the case for most yarn.social pods.
My visions for timeline is to bring back the fun and quirckness of bygone sites such as Geocities of the 1990s and Myspace of the 2000s, that enables creating a personlised place for you to express yourself online and also being able to follow others who inspire you. At the same time providing a good looking basic design with the help of [Simple.css](https://simplecss.org), which allows you to customise the look and feel. Even to the level where timeline aligns with the design of your excsing webpage, like I did on: [darch.dk/timeline](https://darch.dk/timeline).
My visions for timeline is to bring back the fun and quirkiness of bygone sites such as Geocities of the 1990s and Myspace of the 2000s, that enables creating a personalized place for you to express yourself online and also being able to follow others who inspire you.
At the same time providing a good looking basic design with the help of [Simple.css](https://simplecss.org), which allows you to customize the look and feel. Even to the level where timeline aligns with the design of your excsing webpage, like I did on: [darch.dk/timeline](https://darch.dk/timeline).
![](media/screenshot.png)
_Conversation view with replies / Profile view / Gallery View_

View file

@ -41,6 +41,7 @@ $routes = [
'/conv/([a-zA-Z0-9]{7})' => 'conv.php', // matches only twtHash of exactly 7 alphanumeric characters
'/post/([a-zA-Z0-9]{7})' => 'post.php', // matches only twtHash of exactly 7 alphanumeric characters
//'/thumb' => 'thumb.php',
'/upload' => 'upload_img.php',
'/webmention' => 'webmention_endpoint.php',
];

View file

@ -195,7 +195,6 @@ a.author {
.profile a.button {
font-size: small;
/*color: var(--accent); */
background-color: var(--accent-bg);
padding: 0.25em 0.5rem;
margin-left: 0.5rem;

BIN
media/01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

BIN
media/02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

29
twtxt_template.txt Normal file
View file

@ -0,0 +1,29 @@
# | |___ _| |___ _| |_
# | __\ \ /\ / / __\ \/ / __|
# | |_ \ V V /| |_ > <| |_
# \__| \_/\_/ \__/_/\_\\__|
#
# Twtxt is an open, distributed and decentralized microblogging platform
# for hackers and friends that uses raw text files, easy to read by humans,
# and with common protocols and free and open.
#
# Learn more about twtxt here: https://github.com/buckket/twtxt
# And about yarn.social: https://yarn.social
# Using timeline from: https://github.com/sorenpeter/timeline
# Using some extensions from: https://dev.twtxt.net
#
# nick = your_name
# url = http://example.net/twtxt.txt
# avatar = http://example.net/avatar.png
# link = Link Text http://example.net
# description = Bio text about you
#
# Semi-random selection of feeds to get you started:
# follow = eapl.me https://eapl.me/twtxt.txt
# follow = eapl.mx https://eapl.mx/twtxt.txt
# follow = prologic https://twtxt.net/user/prologic/twtxt.txt
# follow = sorenpeter http://darch.dk/twtxt.txt
# follow = stigatle https://yarn.stigatle.no/user/stigatle/twtxt.txt
# follow = yarn_search https://search.twtxt.net/twtxt.txt
#~~~#
2024-04-23T20:05:00Z Testing posting from http://example.net/timeline/

View file

@ -4,10 +4,13 @@ require_once("partials/base.php");
$title = "Following - ".$title;
include 'partials/header.php';
// TODO: Include profile-card, but only tagcloud for user, not all feeds in cache
?>
<center>
<h1><?= $profile->nick ?> follows <?php echo count($twtFollowingList); ?> feeds</h1>
<h2><img src="<?= $profile->avatar ?>" class="avatar"> <?= $profile->nick ?> follows <?php echo count($twtFollowingList); ?> feeds</h2>
<table>

83
views/upload_img.php Normal file
View file

@ -0,0 +1,83 @@
<?php
require_once("partials/base.php");
if (!isset($_SESSION['password'])) {
header('Location: ./login');
die();
}
$title = "Upload - ".$title;
include_once 'partials/header.php';
if (!empty($_POST)) {
// Based on code from: https://www.w3schools.com/php/php_file_upload.asp
//echo getcwd() ."<br>";
//echo __DIR__ . "<br>";
$target_dir = getcwd()."/media/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
echo "Sorry, file already exists.<br>";
$uploadOk = 0;
}
// Check file size
if ($_FILES["fileToUpload"]["size"] > 5000000) {
echo "Sorry, your file is too large.<br>";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.<br>";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded.<br>";
} else {
echo "Sorry, there was an error uploading your file.<br>";
}
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
Select image to upload:<br>
<input type="file" name="fileToUpload" id="fileToUpload"><br>
<input type="submit" value="Upload Image" name="submit">
</form>
<!-- PHP: FOOTER --><?php include_once 'partials/footer.php';?>