SShortSingh.
Back to feed

Developer builds CLI tool to monitor Eslite book stock, bypassing Cloudflare protection

0
·1 views

A developer has created a lightweight command-line tool to query real-time inventory data from Eslite's online store (eslite.com), addressing the limitation of having to manually check each product page individually. The tool calls Eslite's backend API directly and bypasses Cloudflare's TLS fingerprint detection by using the curl-cffi library to impersonate a real Chrome browser, since standard Python HTTP libraries are blocked with a 403 error. Each API request includes a live-generated timestamp parameter, which the backend appears to use for cache validation. The tool supports batch queries via product GUIDs or full URLs, color-coded stock status output, and a watch mode that automatically refreshes results at user-defined intervals. Error handling ensures that a failed lookup for one product does not interrupt the rest of a batch query.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

TypeScript 6.0 isolatedDeclarations Cuts Build Times by Parallelising Declaration Emit

TypeScript 6.0 introduces the isolatedDeclarations feature, which removes the type checker as a dependency during declaration file (.d.ts) generation. Instead of analysing cross-file import chains, the compiler now derives declarations purely from explicit type annotations in each source file, allowing parallel processing. This change can reduce large monorepo build times from several minutes to milliseconds, since each file emits its declarations independently. The tradeoff is stricter code requirements: all exported functions, classes, and variables must carry explicit type annotations, and previously implicit types will surface as hard errors. The feature also makes faster transpilers like esbuild and swc viable for full declaration file workflows, broadening TypeScript's integration options.

0
ProgrammingDEV Community ·

How Leader Election in Distributed Systems Determines Recovery Speed

In distributed systems, agreeing on which node gets to make decisions — known as leader election — is often more costly than agreeing on data transactions. When a controller node fails, services that depend on it for routing and coordination can become completely unavailable until a new leader is chosen. Consensus algorithms like Raft and Paxos handle this by having remaining nodes detect the failure via missed heartbeats, then campaign and vote to elect a replacement. The election process requires a majority quorum and can take anywhere from milliseconds to several seconds based on network conditions and timeout configurations. Platforms like Apache Kafka rely on this mechanism to maintain continuity of their controller node, making election latency a direct driver of system recovery time.

0
ProgrammingDEV Community ·

DEV Community User Asks About Merchandise and Non-Badge Perks

A DEV Community member has raised a question about whether the platform offers tangible perks beyond its existing promotions and badges. The user specifically inquired about the possibility of obtaining DEV-branded merchandise, such as caps or shirts. The question reflects curiosity about how the platform rewards or engages its community members in more physical, real-world ways. No official response or confirmation of such a merchandise program has been mentioned in the post.

0
ProgrammingDEV Community ·

vLLM, llama.cpp, Ollama Benchmarked on a Single RTX 3090 With 24GB VRAM

A home-lab test compared three popular LLM inference frameworks — vLLM, llama.cpp, and Ollama — across five models ranging from 1B to 116.8B parameters on a single RTX 3090 GPU paired with 128GB of system RAM. Within the 24GB VRAM limit, vLLM's continuous batching delivered 3.9x–5.4x throughput gains from concurrency 1 to 8, significantly outpacing llama.cpp's 1.2x–1.9x scaling. When models exceeded VRAM capacity and spilled into RAM, both llama.cpp and Ollama continued generating at single-digit tokens per second, while vLLM crashed with out-of-memory errors at around 22GB used. Steady-state decode speeds were nearly identical across frameworks once warmed up, but time-to-first-token varied sharply — Ollama took 274 seconds versus llama.cpp's 7.3 seconds on the largest model, largely due to Ollama's automatic GPU-layer splitting on a partially RAM-resident model. The energy cost gap was equally stark, with Ollama consuming roughly seven times more electricity per million tokens than llama.cpp on the same 120B model.