diff --git a/App/ApiFake.js b/App/ApiFake.js index 636ecfe..601e4b7 100644 --- a/App/ApiFake.js +++ b/App/ApiFake.js @@ -10,6 +10,13 @@ var FakeApi = { }, }; +FakeApi.Friendiiverse.Featured.Featured.push({ + //Banner: "https://picsum.photos/seed/Testing.Banner/320/180", + //Icon: "https://picsum.photos/seed/Testing.Icon/64", + Name: "mastodon.social", + Url: "https://mastodon.social", + __Display__: "DisplayMastodonTimeline", +}); FakeApi.Friendiiverse.Featured.Featured.push({ Banner: "https://picsum.photos/seed/Testing.Banner/320/180", Icon: "https://picsum.photos/seed/Testing.Icon/64", diff --git a/App/ApiTransform.js b/App/ApiTransform.js index 8be498a..95ac3b1 100644 --- a/App/ApiTransform.js +++ b/App/ApiTransform.js @@ -22,11 +22,11 @@ var TransSchemas = { */ var ApiSchema = { - __All__: { - SourceInstance: { - __Eval__: "", - }, - }, + //__All__: { + // __Software__: { + // __EvalSet__: "TypeOld", + // }, + //}, Note: { Content: { Mastodon: "content", @@ -82,7 +82,7 @@ var ApiSchema = { var ApiEndpoints = { FetchNotes: { Mastodon(Profile) { - return `accounts/${Profile.Id}/statuses`; + return `GET accounts/${Profile.Id}/statuses`; }, }, }; diff --git a/App/Main.js b/App/Main.js index fd29f6f..0fba337 100644 --- a/App/Main.js +++ b/App/Main.js @@ -43,7 +43,7 @@ function DoAsync(First, Then, Data) { }, }; // Call all First functs - ForceList(First).forEach(function(Fun, Data){ + ForceList(First).forEach(function(Fun){ var Task = RndId(); var Proc = [Job, Task]; Tasker[Job][Task] = {}; @@ -78,24 +78,40 @@ function DisplayProfile(Profile) { `; - DoAsync(FetchMastodon, FillTimeline, Profile); + DoAsync(FetchNotes, FillTimeline, Profile); +}; + +function DisplayMastodonTimeline(Data) { + var Window = MkWindow(); + Window.innerHTML += `
`; + DoAsync(FetchNotes, FillTimeline, Profile); }; function FetchNotes(Profile, Proc) { var Soft = Profile.__Software__; - NetApiCall({Target: Soft, Method: ApiEndpoints.FetchNotes[Soft](Profile), CallFine: function(Res){ - var Notes = ApiTransform(Res.responseJson, 'Mastodon', 'Note'); + NetApiCall({Target: UrlBase(Profile.Url), Method: ApiEndpoints.FetchNotes['Mastodon'](Profile), CallFine: function(Res){ + var Notes = ApiTransform(Res.responseJson, Soft, 'Note'); LogDebug(Notes, 'l'); Tasker[Res.Proc[0]].Return(Notes); }}, Proc); }; function FetchMastodon(Proc) { - if (UseFakeApi) { - ResFetchMastodon({responseJson: [FakeApi.Mastodon.Status], Proc: Proc}); - } else { - NetApiCall({Target: "Mastodon", Method: "timelines/public", CallFine: ResFetchMastodon}, Proc); - }; + //if (UseFakeApi) { + // ResFetchMastodon({responseJson: [FakeApi.Mastodon.Status], Proc: Proc}); + //} else { + NetApiCall({Target: "Mastodon", Method: "GET timelines/public", CallFine: ResFetchMastodon}, Proc); + //}; }; function ResFetchMastodon(Res) { var Notes = ApiTransform(Res.responseJson, 'Mastodon', 'Note'); @@ -136,7 +152,7 @@ function FillFeatured(Categories) { Object.values(Categories).forEach(function(Profiles){ Profiles.forEach(function(Profile){ Window.innerHTML += `