Skip to content

gorkemozkan/koeri-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KOERI Scraper

npm version License: MIT

A library and CLI tool for scraping, filtering, and reporting earthquake data from KOERI (Kandilli Observatory and Earthquake Research Institute).

Features

  • CLI and API
  • Advanced filtering
  • JSON and Markdown support
  • Zero runtime dependencies

Installation

npm install koeri-scraper

Quick Start

Library Usage

import { createApp } from 'koeri-scraper';

const app = createApp();

// Fetch all earthquakes
await app.run();

// Filter by province and generate reports
await app.run({
  province: 'izmir',
  generateJson: true,
  generateMarkdown: true
});

// Advanced filtering
await app.runWithCustomFilters({
  location: { province: 'izmir', keywords: ['torbalı'] },
  magnitude: { min: 2.0, max: 5.0 },
  depth: { max: 10 }
});

CLI Usage

# Install globally
npm install -g koeri-scraper

# Or use with npx
npx koeri-scraper

# Filter by province with JSON output
koeri-scraper --province izmir --json

# Filter by keywords with both outputs
koeri-scraper --keywords torbalı,dikili --json --markdown

# Combine filters
koeri-scraper --province izmir --keywords torbalı --json --verbose

API Reference

createApp()

Creates a new EarthquakeApp instance.

app.run(options?)

interface AppOptions {
  locationKeywords?: string[];
  province?: string;
  generateJson?: boolean;
  generateMarkdown?: boolean;
}

app.runWithCustomFilters(filterCriteria, options?)

interface FilterCriteria {
  location?: { keywords?: string[]; province?: string; };
  magnitude?: { min?: number; max?: number; };
  date?: { start?: string; end?: string; };
  depth?: { min?: number; max?: number; };
}

app.getParsingStats()

Returns parsing statistics (parsed count, errors, success rate).

CLI Options

  • --province <name> - Filter by province
  • --keywords <list> - Filter by keywords (comma-separated)
  • --json - Generate JSON report
  • --markdown - Generate Markdown report
  • --verbose, -v - Enable verbose logging
  • --debug - Enable debug mode
  • --no-color - Disable colored output
  • --help, -h - Show help

Documentation

For detailed documentation, examples, and advanced usage, see DOCS.md.

About

An application for scraping, filtering, and reporting earthquake data from the Kandilli Observatory.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors