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

GS1 x Scrapp: Download the Whitepaper

Evan Gwynne Davies
December 7, 2022
2 minutes

GS1 recently published a whitepaper about Scrapp - see link to download below.

Inside they outline how Scrapp is uniquely positioned to enable forward-thinking cities, businesses and organisations to support a waste-free future.

Who are GS1?

GS1 are a global non-profit responsible for the majority of the barcodes on shelves today. The organisation, which was founded in the 1970s, provides unique identification standards for products, services, and locations that are used by millions of companies around the world. These standards help businesses accurately identify and track products as they move through the supply chain, enabling efficient and effective communication and collaboration between trading partners.

How can Scrapp support you?

Our latest technologies, such as the Scrapp Separation Station, have already begun helping some of the world's leading organisations, including Microsoft and National Grid, and British Airways to drive results. We do this by engaging people to recycle right to minimise contamination rates. Our not so secret weapon?  Our patent-pending tech that enables us to provide accurate recycling guidance which responds to the rules in your local area, office, or building.

We also consult with brands and offer sustainable auditing packages. You get a comprehensive report which includes a data-driven analysis of the recyclability of your entire product-packaging offering, and complete with action steps you can take to reduce your impact.

Our free app is available on iOS and Android, and we have some huge announcements to make coming soon. We work with local authorities to provide a completely tailored experience for their residents.

How to get in touch?

Want to be part of a waste-free future? Get in touch if you'd like to find out how we can help you achieve your zero-waste goals.

Download the GS1 whitepaper for FREE

https://www.gs1us.org/content/dam/gs1us/documents/industries-insights/start-up-labs/GS1US-2022-Startup-Lab-Whitepaper-Scrapp.pdf

Article by
Evan Gwynne Davies