Skip to content

Commit 8698447

Browse files
authored
Merge pull request #43 from benjaminbeer256/main
Added honeypot link and page
2 parents 5f56544 + 106f749 commit 8698447

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/app/honeypot/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use client"
2+
3+
export default function HoneypotPage() {
4+
return (
5+
<div className="min-h-screen bg-white dark:bg-black text-black dark:text-white p-8 flex flex-col items-center text-center">
6+
<img className="mb-8" src="https://upload.wikimedia.org/wikipedia/en/1/10/Winniethepooh.png"
7+
/>
8+
<p>
9+
Thanks for finding the honey pot! We&apos;re trying to find the proportion
10+
of visitors who are bots, and your IP address has been recorded. If you
11+
would like to have your data removed from the study email bob28@cornell.edu
12+
with your request and I&apos;ll address it promptly!
13+
</p>
14+
</div>
15+
);
16+
}

src/app/layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export default function RootLayout({
136136
>
137137
Get Involved
138138
</Link>
139+
<Link
140+
href="/honeypot"
141+
className="display: none"
142+
>
143+
</Link>
139144
</nav>
140145
</div>
141146

@@ -303,6 +308,14 @@ export default function RootLayout({
303308
</div>
304309
</div>
305310
</footer>
311+
{pathname === '/honeypot' && (
312+
<Script id="honeypot-event" strategy="afterInteractive">
313+
{`fetch('https://api.ipify.org?format=json')
314+
.then(response=>response.json())
315+
.then(data=>gtag('event','honeypot_triggered',{user_ip:data.ip}))
316+
.catch(()=>gtag('event','honeypot_triggered',{user_ip:'unknown'}));`}
317+
</Script>
318+
)}
306319
</body>
307320
</html>
308321
);

0 commit comments

Comments
 (0)