Skip to content

Instantly share code, notes, and snippets.

@munky69rock
Created September 1, 2020 05:56
Show Gist options
  • Save munky69rock/430307c87d19bb17bd3c1d2870e1d52a to your computer and use it in GitHub Desktop.
Save munky69rock/430307c87d19bb17bd3c1d2870e1d52a to your computer and use it in GitHub Desktop.
How to use Twitter widget with Fruition (https://fruitionsite.com/)
@@ -88,6 +88,12 @@ async function fetchAndApply(request) {
}
const notionUrl = 'https://www.notion.so' + url.pathname;
let response;
+
+ // Twitter Widget
+ if (url.pathname.startsWith('/twitter') && url.pathname.endsWith('js')) {
+ return fetch(notionUrl);
+ }
+
if (url.pathname.startsWith('/app') && url.pathname.endsWith('js')) {
response = await fetch(notionUrl);
let body = await response.text();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment