Scrapp Zero | Home
const PRISM_API_KEY = 'prism_jrfvXGHXOMscbgOD7NrcMgO5K2oQ4OqZ'; const PRISM_ENDPOINT = 'https://prism.trakkr.ai'; const PRISM_TIMEOUT = 1000; // ms // Crawler patterns to optimize for (customizable) const AI_CRAWLERS = [ 'gptbot', 'chatgpt-user', 'oai-searchbot', 'claudebot', 'claude-user', 'claude-searchbot', 'perplexitybot', 'meta-externalagent', 'google-extended', 'cohere-ai', 'applebot-extended', 'amazonbot', 'baiduspider', 'bytespider' ]; addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)); }); async function handleRequest(request) { const url = new URL(request.url); // Quick bypass for non-HTML requests if (url.pathname.match(/\.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot)$/i)) { return fetch(request); } // Check if AI crawler const ua = (request.headers.get('user-agent') || '').toLowerCase(); const isAICrawler = AI_CRAWLERS.some(bot => ua.includes(bot)); if (!isAICrawler) { return fetch(request); } // Detect crawler type const crawlerType = AI_CRAWLERS.find(bot => ua.includes(bot)) || 'unknown'; try { // Call Prism API with tight timeout const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), PRISM_TIMEOUT); const prismResponse = await fetch(PRISM_ENDPOINT, { method: 'POST', headers: { 'X-API-Key': PRISM_API_KEY, 'X-Crawler-UA': ua.substring(0, 200), 'X-Target-URL': url.toString(), 'Content-Type': 'application/json' }, body: JSON.stringify({ url: url.toString(), pathname: url.pathname, crawler: crawlerType }), signal: controller.signal }); clearTimeout(timeoutId); // Handle rate limiting if (prismResponse.status === 429) { console.log('Prism limit reached'); return fetch(request); } // Handle successful optimization if (prismResponse.ok) { const data = await prismResponse.json(); if (data.optimizedHTML) { return new Response(data.optimizedHTML, { status: 200, headers: { 'Content-Type': 'text/html;charset=UTF-8', 'X-Prism-Optimized': 'true', 'X-Prism-Cache': data.cache || 'MISS' } }); } } } catch (error) { // Timeout or error - serve original immediately console.error('Prism error:', error.message); } // Default: serve original content return fetch(request); }
Team Announcement

Microsoft makes first move towards zero-waste goals

Dan Marek
September 18, 2022
2 minutes

This week is recycle week 2022 - and we couldn't be happier to share with you some scrapp-tastic news!

Off the back of our involvement in Microsoft's Sustainability Accelerator, we were tasked with helping corporate teams to reach their Zero-Waste Goals. So we pitched them our latest innovation: the Scrapp Separation Station. And guess what...they said YES! So launching this recycling week, Microsoft HQ will have access to not one but two Scrapp Separation Stations.

What's a Scrapp Separation Station?

An all-in-one tool to help businesses and organisations empower their teams (and customers) to recycle correctly. Ultimately we want people to feel good about recycling right so we can work together towards zero-waste goals.

How does the Scrapp Separation Station work?

It works similarly to our award-winning mobile app, with a few extra powerful features. You can walk up to the station and scan your items to see how to recycle them based on local recycling rules. And for those everyday items without barcodes (such as coffee cups, food waste, and takeaway packaging), you can quickly tap on your item of choice within your very own recycling wiki.

To help motivate teams to get involved, Scrapp makes it easy to set up community goals, challenges and leaderboards. For example, your company pledges to make a contribution to your charity of choice once your team successfully recycles 100 items correctly. This helps to ensure that recycling right becomes a whole team effort and that we can make a genuinely positive impact together.

What's next?

We'll continue to work closely alongside the Microsoft sustainability team to help them reach their Zero-waste goals - and we're looking forward to sharing the results with you!

In the meantime, please drop us a message if you'd like to chat about deploying Scrapp's Separation Stations at your office, venue, or event space. Oh, and as your reward for reading this far, we're giving away your first 3 months FREE - just include the code RECYCLEWEEK22 when you reach out to us 🤩♻️

Don't like forms?
enquiries@scrapprecycling.com

Article by
Dan Marek