xiaohongshu
xiaohongshu
Manages full data retrieval while respecting Knack's 1,000-record-per-page limit. Essential for HTI's 3,500+ laptop inventory and compliance report...
Full skill instructions
Manages full data retrieval while respecting Knack's 1,000-record-per-page limit. Essential for HTI's 3,500+ laptop inventory and compliance reporting.
Knack API Limit: Maximum 1,000 records per request
Purpose: Retrieve complete dataset across multiple pages
Parameters:
object_key (string, required): Target Knack objectrows_per_page (integer, optional): Records per page (default: 1000)filters (object, optional): Apply consistent filters across all pagessort (object, optional): Maintain sort order across pagesLogic:
async function fetch_all_pages(object_key, rows_per_page = 1000) {
let all_records = [];
let current_page = 1;
let total_pages = null;
while (total_pages === null || current_page <= total_pages) {
const response = await get_records({
object_key,
params: { rows_per_page, page: current_page }
});
all_records = all_records.concat(response.records);
total_pages = response.total_pages;
current_page++;
// Rate limit protection
await sleep(100); // 10 requests/second max
}
return all_records;
}
Example:
// Retrieve all 3,500+ laptops
const all_laptops = await fetch_all_pages("object_1");
console.log(`Retrieved ${all_laptops.length} total laptops`);
Purpose: Show progress for large dataset retrieval
Example:
const laptops = await paginate_with_progress({
object_key: "object_1",
on_page: (page, total) => {
console.log(`Fetching page ${page} of ${total}...`);
}
});
Purpose: Memory-efficient processing for very large datasets
Use Case: Processing 3,500+ laptops without loading all into memory
Example:
await stream_records({
object_key: "object_1",
process_batch: (batch) => {
// Process 1,000 records at a time
const ready_count = batch.filter(l => l.status === "Ready").length;
console.log(`Batch ready count: ${ready_count}`);
}
});
Caution: Respect 10 req/sec rate limit
// Fetch pages 1-5 in parallel (with rate limiting)
const pages = await Promise.all([
get_records({ object_key: "object_1", params: { page: 1 }}),
get_records({ object_key: "object_1", params: { page: 2 }}),
get_records({ object_key: "object_1", params: { page: 3 }}),
get_records({ object_key: "object_1", params: { page: 4 }}),
get_records({ object_key: "object_1", params: { page: 5 }})
]);
Use: Dashboards showing "last 100 records"
// Only fetch first page for dashboard preview
const recent = await get_records({
object_key: "object_1",
params: { rows_per_page: 100, page: 1 }
});
// All laptops acquired in Q1 2025
const q1_laptops = await fetch_all_pages("object_1", {
filters: {
field: "acquisition_date",
operator: "is during",
range: { start: "2025-01-01", end: "2025-03-31" }
}
});
// Paginate through all devices, group by county
const all_devices = await fetch_all_pages("object_1");
const by_county = groupBy(all_devices, "target_county");
// All donations from last 12 months
const donations = await fetch_all_pages("object_2", {
filters: {
field: "donation_date",
operator: "is after",
value: "2024-01-01"
}
});
async function fetch_with_rate_limit(object_key) {
const delay = 100; // 10 req/sec = 100ms between requests
for (let page = 1; page <= total_pages; page++) {
await sleep(delay);
const data = await get_records({ object_key, params: { page }});
// Process data...
}
}
async function fetch_all_with_retry(object_key, max_retries = 3) {
let retries = 0;
while (retries < max_retries) {
try {
return await fetch_all_pages(object_key);
} catch (error) {
if (error.status === 429) {
// Rate limit - wait and retry
await sleep(1000 * Math.pow(2, retries));
retries++;
} else {
throw error;
}
}
}
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience