From 8de51e853fd63c6ad6f7310bea4565fba2e03fca Mon Sep 17 00:00:00 2001 From: idotj Date: Sun, 23 May 2021 17:46:28 +0200 Subject: [PATCH] Update Readme + rename formatDate function --- README.md | 28 ++++++++++++++++++++++++++-- src/mastodon-timeline.js | 4 ++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e05fa6..eed5fb2 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,38 @@ # Mastodon embed timeline -Embed a mastodon feed timeine in your page, with just html, css and js. +Embed a mastodon feed timeine in your page, only with a css and js file. Working version running at: https://www.idotj.com ## User guide +Just copy both files (.css and .js) in your project +``` + +``` -## Licensing +``` + +``` + +and add the following structure in your html page: +``` +
+
+
+
+
+``` + +## Changing the profile + +At the beginning of the JS file *mastodon-timeline.js* replace the following values: +``` + instance_uri: '', + account_id: '', + profile_name: '', +``` ## Improve me diff --git a/src/mastodon-timeline.js b/src/mastodon-timeline.js index b79a7db..6f6b0b0 100644 --- a/src/mastodon-timeline.js +++ b/src/mastodon-timeline.js @@ -106,7 +106,7 @@ MastodonApi.prototype.getToots = function () { + ''; // Date - date = formatDate(status_.reblog.created_at); + date = this.formatDate(status_.reblog.created_at); } else { // STANDARD toot // Toot url @@ -129,7 +129,7 @@ MastodonApi.prototype.getToots = function () { + ''; // Date - date = formatDate(status_.created_at); + date = this.formatDate(status_.created_at); } // Main content