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); }
Sustainable Impact

How does Scrapp offset my plastic footprint?

Dan Marek
April 1, 2022
3 min read

Plastic and our oceans don’t mix. We’re here to do something about it.

One of the simplest ways to keep plastic pollution out of the ocean is by putting our trash into the right bin. Despite this, scientists predict that there will be more pieces of plastic than fish by 2050.

That’s why we’re proud to be working with rePurpose. With their help, we’re going one step further, together. By removing ocean-bound plastic — one scan at a time.

How does it work?

Each time you use our clever little app to recycle correctly, we make a donation to rePurpose to purchase plastic credits. These plastic credits guarantee that a certain amount of plastic will be intercepted from the environment via one of their global projects. For every 5 items you scan, we purchase enough plastic credits to offset the equivalent of 1 plastic bag. Add accurate, new product packaging info to our library, and we’ll remove an additional bag.

With Scrapp, the more products you scan, the better you’ll become at recycling. And together, the more plastic pollution we can stop from entering our oceans. So you can live guilt-free and be confident that your efforts will never go to waste.

Who are rePurpose?

RePurpose Global is the world’s leading Plastic Action Platform. Their mission is to reduce waste, revive lives, and restore nature’s balance. How? By funding plastic recovery projects across six countries — including Kenya, Indonesia, and India. Their international offset standard is backed by the World Wildlife Fund, World Bank, and United Nations Environment Programme.

Why plastic offsetting?

At Scrapp, we believe offsets can play a valuable role in reducing plastic pollution so long as they’re not an excuse for delayed action. We decided to establish our plastic offsetting initiative to:

a) Motivate & reward people for recycling more often.
b) Ensure that planet-positive efforts never go to waste.

We’re taking action by empowering people to sort stuff into the right bin. We are then leveraging our data-driven insights to help brands & retailers make more sustainable packaging decisions at the source.

What else is Scrapp doing to support a more sustainable future?

Aside from helping 100+ million people with access to free, local recycling guidance, we’re taking additional steps towards a better, more sustainable future for everyone by:

  1. Clearing up confusing environmental claims (AKA greenwashing) with our Scrapp Verified program.
  2. Establishing a trusted certification program to hold brands and retailers accountable — basically the Tripadvisor for recycling.
  3. Featuring alternative disposal options for tricky to recycle products, e.g. soft plastic drop-offs and E-Waste.

How do I measure my impact?

To track progress towards your low-waste goals, visit the overview page in the app. You can also sign up for our newsletter or follow our socials to learn more about the brilliant projects we’ll be supporting.

Article by
Dan Marek