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); }
For Business

Custom Machine | Manufacturing a cheaper waste bill

October 10, 2024

The waste management landscape is evolving, even the most efficient businesses can face unexpected challenges. A manufacturing client recently experienced a 35% surge in their waste bill, less than 12 months into using our services. Concerned about the anomaly, they reached out to the Scrapp team for clarity and resolution.

Challenge

The client wanted to know if this increase was typical and sought solutions to mitigate the costs. With no apparent change in their waste stream or the services being provided, identifying the root cause became imperative.

Our Approach

Scrapp’s advanced waste categorization system was employed to collect and analyze data on the client’s waste stream. Through meticulous tracking, we confirmed that the volume and nature of the waste, as well as the services rendered, remained unchanged.

Armed with this verified data, our team initiated a strategic conversation with the client’s waste hauler. Using clear insights and projections that accounted for material flow growth and inflation trends, we advocated for a fair and transparent adjustment.

Outcome

Our data-backed negotiation led to a 30% reduction in the client’s waste bill. This significant cost-saving not only offset the initial surge but also set a precedent for sustainable cost management as the client’s operations evolve.

Key Takeaways

This case underscores the importance of leveraging precise waste data to identify discrepancies, drive negotiations, and ensure cost efficiency. At Scrapp, we believe that knowledge is power - especially when it leads to actionable outcomes that align with your zero-waste goals.

How can Scrapp help?

If this is a problem you have faced, book in a time with the Scrapp team to learn how we can help you make your data work for you.