diff --git a/Build.py b/Build.py index f832a6b..548e87f 100755 --- a/Build.py +++ b/Build.py @@ -2,12 +2,13 @@ import os from pathlib import Path +os.chdir(os.path.dirname(os.path.abspath(__file__))) os.makedirs('./Dist', exist_ok=True) with open('./Friendiiverse.html', 'r') as Base: Base = Base.read() -def FragReplace(Find, Replace, Pattern='*.*', Folder='./'): +def FragReplace(Find, Replace, Pattern='*.*', Folder='./Source/'): global Base for File in Path('./').rglob(Pattern): with open(File, 'r') as Frag: diff --git a/Source/ApiTransform.js b/Source/ApiTransform.js new file mode 100644 index 0000000..8c6853b --- /dev/null +++ b/Source/ApiTransform.js @@ -0,0 +1,26 @@ +var TransSchemas = { + Mastodon: { + Account: { + "__": "Author", + "url": "Url", + }, + Status: { + "__": "Note", + "account": {"__": "Account"}, + "content": "Content", + "created_at": "Time", + "url": "Url", + }, + }, +}; + +var TransParsers = { + Mastodon: { + Account(Data) { + return JsonTransform(Data, TransSchemas.Mastodon.Author, TransSchemas.Mastodon); + }, + Status(Data) { + return JsonTransform(Data, TransSchemas.Mastodon.Status, TransSchemas.Mastodon); + }, + }, +}; diff --git a/Source/FakeApi.js b/Source/FakeApi.js new file mode 100644 index 0000000..35bebeb --- /dev/null +++ b/Source/FakeApi.js @@ -0,0 +1,6 @@ +var FakeApi = { + // + Mastodon: { + //"timelines/public": + }, +}; diff --git a/Friendiiverse.html b/Source/Friendiiverse.html similarity index 84% rename from Friendiiverse.html rename to Source/Friendiiverse.html index d72e558..87f7209 100644 --- a/Friendiiverse.html +++ b/Source/Friendiiverse.html @@ -6,7 +6,7 @@ - + +