diff --git a/src/routes/corporate-lobbying-tracker/+page.svelte b/src/routes/corporate-lobbying-tracker/+page.svelte new file mode 100644 index 00000000..339af9a2 --- /dev/null +++ b/src/routes/corporate-lobbying-tracker/+page.svelte @@ -0,0 +1,234 @@ + + + + + + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Latest Lobbiyng Disclosure Tracker · stocknear + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+
+
+ +
+
+ + +
+
+

+ Lobbying Tracker +

+
+ + + Track the latest lobbying spendings of US stock companies + + + +
+ + + + + +
+ + + + +
+ + {#if isLoaded} + + + +
+ + +
+ + + + + + + + + + + + {#each displayList as item, index} + + goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] {index+1 === displayList?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} cursor-pointer"> + + + + + + + + + + + + + + + + + + + {/each} + +
+ Symbol + + Date + + Sector + + Amount +
+
+ {item?.ticker} + + {item?.name?.length > charNumber ? item?.name?.slice(0,charNumber) + "..." : item?.name} + +
+
+ {item?.date} + + {item?.sector} + + {item?.amount} +
+
+ + + +
+ + {:else} +
+
+ +
+
+ {/if} + + +
+
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/src/routes/corporate-lobbying-tracker/+page.ts b/src/routes/corporate-lobbying-tracker/+page.ts new file mode 100644 index 00000000..8b6e249e --- /dev/null +++ b/src/routes/corporate-lobbying-tracker/+page.ts @@ -0,0 +1,39 @@ +import {getCache, setCache } from '$lib/store'; + + + +export const load = async ({parent}) => { + + const getCramerTracker = async () => { + let output; + + const cachedData = getCache('', 'getCramerTracker'); + if (cachedData) { + output = cachedData; + } else { + + const { apiKey, apiURL } = await parent(); + + const response = await fetch(apiURL + '/lobbying-tracker', { + method: 'GET', + headers: { + "Content-Type": "application/json", "X-API-KEY": apiKey + }, + }); + + output = await response.json(); + + setCache('', output, 'getCramerTracker'); + + } + + //output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output; + + return output; + }; + + // Make sure to return a promise + return { + getCramerTracker: await getCramerTracker() + }; +}; \ No newline at end of file diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index 35d50c3a..d89f9bf3 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -184,8 +184,8 @@ onMount( async() => { {/if}
- - Realtime Wallstreetbets Tracker + + Corporate Lobbying Tracker