🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/maksim77/parkrun-crawler

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/maksim77/parkrun-crawler

v0.0.0-20200716214827-ea7e44ac5d24
Source
Go
Version published
Created
Source

parkrun-crawler

npm npm

Unfortunatley Parkrun does not provide an API to query athlete or run information - this module provides an easy way to pull athlete data straight from the Parkrun website.

Currently only the athlete result history page can be crawled using the getAthlete(athleteId) method.

getAthlete returns a promise that will resolve with the crawled athlete data.

Usage

const { getAthlete } = require("parkrun-crawler");

async function myFunc() {
  try {
    athlete = await getAthlete("2054291");
    console.log(athlete);
  } catch (e) {
    console.log(e);
  }
}
myFunc();

Will output the following:

{
    name: 'Matt DOWNS',
    totalRuns: 73,
    recentRuns: [{
        event: 'Ashgrove parkrun',
        eventUrl: 'http://www.parkrun.com.au/ashgrove/results',
        date: '14/04/2018',
        genderPosition: 38,
        overallPosition: 41,
        time: '23:33',
        ageGrade: '54.78%'
    }],
    eventSummary: [{
        event: 'Ashgrove parkrun',
        eventUrl: 'http://www.parkrun.com.au/ashgrove/results',
        count: 49,
        bestGenderPosition: 2,
        bestOverallPosition: 2,
        bestTime: '00:20:20'
    }],
    volunteerSummary: [{
        year: '2017',
        role: 'Photographer',
        count: 1
    }]
}

(recentRuns, eventSummary and volunteerSummary shortened for display purposes)

FAQs

Package last updated on 16 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts