Project Home

Tribhuvan University Notice Scraper

A fast, resilient, and fully type-safe TypeScript scraper engine built specifically for official Tribhuvan University administrative portals across 8 faculties and institutes.

Note: Official tu.edu.np Sources Only

All scrapers query only verified Tribhuvan University administrative domains (iost.tu.edu.np, ioe.tu.edu.np, iom.tu.edu.np, etc.). No third-party blogs or unverified aggregators are queried.

Installation

npm install tu-scraper

Quick Start Example

import { getNotices, getLatest, getNoticeDetail } from 'tu-scraper';

// 1. Fetch recent notices from IOST (Science & Technology)
const notices = await getNotices('iost', { timeout: 8000 });
console.log(`Fetched ${notices.length} notices from IOST`);

// 2. Fetch single newest notice from Engineering (IOE)
const latestIOE = await getLatest('ioe');
console.log('Latest notice:', latestIOE.title);

// 3. Extract deep body text, scanned images, and PDF attachments
if (notices[0]) {
  const detail = await getNoticeDetail(notices[0].url, 'iost');
  console.log('PDFs:', detail.attachments?.filter(a => a.type === 'pdf'));
  console.log('Images:', detail.attachments?.filter(a => a.type === 'image'));
}

Design & Architecture

Zero Browser Overhead (No Puppeteer/Chromium)

Built on Node.js native fetch and cheerio HTML parser. Runs in lightweight serverless functions, Edge runtimes, Docker containers, or background cron workers without heavy headless browser binaries.

Deep Attachment & Scanned Notice Extraction

Many TU notices are published as scanned JPG/PNG images or embedded PDFs. The parser extracts every attachment, resolves relative URLs to absolute CDN links, and classifies them by MIME type.

Typed Error Hierarchy

Structured error classes including InvalidSourceError, NetworkError, RateLimitError, and ParserError allow programmatic handling.

In-Memory TTL Caching & Concurrency Control

Built-in memory cache minimizes redundant requests to university servers while configurable concurrency limits prevent rate-limiting when querying 'all' sources.

Documentation Sections

Supported Faculties & Institutions

Source KeyInstitution NameCategoryOfficial DomainAction
"iost"Institute of Science and TechnologyInstituteiost.tu.edu.np
"fohss"Faculty of Humanities and Social SciencesFacultyfohss.tu.edu.np
"ioe"Institute of EngineeringInstituteioe.tu.edu.np
"iom"Institute of MedicineInstituteiom.tu.edu.np
"iaas"Institute of Agriculture and Animal ScienceInstituteiaas.tu.edu.np
"iof"Institute of ForestryInstituteiof.tu.edu.np
"foe"Faculty of EducationFacultyfoe.tu.edu.np
"fol"Faculty of LawFacultyfol.tu.edu.np