Skip to content

mmankos/ttfmes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttfmes - tootoot.fm Event Scraper

A tootoot.fm scraper for cities, profiles (establishments, artists), but also individual events.

⚠️ Important Notice

When using this package to scrape:

  • Always respect the robots.txt rules of the target website.
  • Only scrape data you are authorized to access.
  • Excessive or unauthorized scraping may violate terms of service.
  • Use the concurrency and the minTime option responsibly to avoid overloading servers.

Instalation

npm install @mmankos/ttfmes

Usage

import { Ttfmes } from "@mmankos/ttfmes";

/**
 * Create a new Ttfmes instance to scrape events.
 *
 * scrapeType options:
 *   - "city": Scrape all events in a specific city.
 *       Required params: { cityName: string, latEst: number, lonEst: number }
 *   - "profile": Scrape events from a specific Facebook profile.
 *       Required params: { profileID: string }
 *   - "event": Scrape a specific event by its ID.
 *       Required params: { eventID: string }
 *
 * Optional configuration (options):
 *   - concurrency: number — Maximum parallel requests (default: 5)
 *   - minTime: number — Minimum delay (ms) between requests (default: 200)
 *   - jitter: number — Random variation in delay (0.3 = ±30%, default: 0.3)
 *   - outputFile: string|null — Path to save results as JSON (default: null, no file saved)
 */

// Example 1: Scrape city events
const ttfmesCity = new Ttfmes("city", {
	cityName: "Košice",
	latEst: 48.7172272,
	lonEst: 21.2496774,
}, {
	concurrency: 10,
	minTime: 100,
	jitter: 0.2,
	outputFile: "city-events.json",
});

// Example 2: Scrape events from a profile
const ttfmesProfile = new Ttfmes("profile", {
	profileID: "61cadd296e298b03d8d4ad22",
}, {
	concurrency: 5,
	outputFile: "profile-events.json",
});

// Example 3: Scrape a specific event
const ttfmesEvent = new Ttfmes("event", {
	eventID: "690916c356061e415d53fb07",
});

// Run the scraping
(async () => {
	console.dir(await ttfmesCity.scrape(), { depth: null });
	console.dir(await ttfmesProfile.scrape(), { depth: null });
	console.dir(await ttfmesEvent.scrape(), { depth: null });
})();

About

A tootoot.fm scraper for cities, profiles (establishments, artists), but also individual events.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors