{"id":30261662,"url":"https://github.com/peerigon/scrapegoat","last_synced_at":"2025-10-27T20:37:01.914Z","repository":{"id":27721492,"uuid":"31208803","full_name":"peerigon/scrapegoat","owner":"peerigon","description":"Fetches calendar/event objects from a CalDav server","archived":false,"fork":false,"pushed_at":"2023-01-07T07:21:59.000Z","size":978,"stargazers_count":30,"open_issues_count":11,"forks_count":13,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-08-09T15:43:57.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peerigon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-23T13:19:42.000Z","updated_at":"2024-11-26T19:34:21.000Z","dependencies_parsed_at":"2023-01-14T07:21:40.829Z","dependency_job_id":null,"html_url":"https://github.com/peerigon/scrapegoat","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/peerigon/scrapegoat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fscrapegoat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fscrapegoat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fscrapegoat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fscrapegoat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peerigon","download_url":"https://codeload.github.com/peerigon/scrapegoat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerigon%2Fscrapegoat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270480754,"owners_count":24591224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-15T20:55:23.114Z","updated_at":"2025-10-27T20:37:01.848Z","avatar_url":"https://github.com/peerigon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrapegoat\n\n[![Build Status](https://travis-ci.com/peerigon/scrapegoat.svg?branch=master)](https://travis-ci.com/peerigon/scrapegoat)\n[![Dependency Status](https://david-dm.org/peerigon/scrapegoat.svg)](https://david-dm.org/peerigon/scrapegoat)\n\nThis library requests a calendar object and its events provided by a CalDav server.\n\nSpecify basic configuration:\n\n```javascript\nconfig = {\n    auth: {\n        user: \"username\",\n        pass: \"password\"\n    },\n    // example using baikal as CalDAV server\n    uri: \"http://example.com/cal.php/calendars/\u003cuser name\u003e/\u003ccalendar name\u003e\"\n};\n```\n\nThe request will timeout if it gets no reponse from the CalDav server after 10 seconds.\nAn optional `timeout` parameter can be provided to override this default by passing an integer containing the number of milliseconds to wait for the server to send the response before aborting the request.\n\n```javascript\nconfig = {\n    auth: {\n        user: \"username\",\n        pass: \"password\"\n    },\n    uri: \"http://example.com/cal.php/calendars/\u003cuser name\u003e/\u003ccalendar name\u003e\",\n    timeout: 20000\n};\n```\n\n## API\n\n### scrapegoat.getCtag()\n\nFetches the ctag of a calendar. You can use the calendar's ctag to see if anything in the calendar has changed.\n\n```javascript\nconst Scrapegoat = require(\"scrapegoat\");\n\nconst scrapegoat = new Scrapegoat(config);\n\nscrapegoat.getCtag().then(console.log);\n```\n\nYou'll get an object, which looks like this:\n\n```javascript\n{\n   href: '/cal.php/calendars/test/holidays/',\n   name: 'Holiday',\n   ctag: '452'\n}\n```\n\n### scrapegoat.getEtags()\n\nFetches the etags of all events. You can use the events etags to see if an event has changed.\n\n```javascript\nscrapegoat.getEtags().then(console.log);\n```\n\nYou'll get an array of objects, which looks like this:\n\n```javascript\n[\n    {\n        ics: \"/cal.php/calendars/test/holidays/6151613161614616.ics\",\n        etag: \"fc46dd304e83f572688c68ab63816c8f\"\n    },\n    {\n        ics: \"/cal.php/calendars/test/holidays/6816189165131651.ics\",\n        etag: \"8d59671ba294af1de0e0b154a8ea64c2\"\n    }\n];\n```\n\n### scrapegoat.getEvents(events)\n\nFetches events with its data/details. `events` has to be an array with objects, which contain an ics attribute. The ics attribute has to look like the ones we get with `getEtags()`.\n\n```javascript\nconst events = [\n  { ics: '/cal.php/calendars/user/calendar_name/12345.ics' }\n  { ics: '/cal.php/calendars/user/calendar_name/67890.ics' }\n];\n\nscrapegoat.getEvents(events).then(console.log);\n```\n\nOutput should be something like this:\n\n```javascript\n[\n    {\n        ics: \"/cal.php/calendars/test/holidays/1234564316516.ics\",\n        etag: \"fc46dd304e83f572688c68ab63816c8f\",\n        data: {\n            title: \"Holiday: John Doe\",\n            uid: \"56ea42c0-e4af-4ac8-8d60-d95996c9ddc5\",\n            location: \"Kissing, Augsburg, Germany\",\n            description: null,\n            start: \"2017-02-16T00:00:00.000Z\",\n            end: \"2017-02-18T00:00:00.000Z\",\n            duration: {\n                weeks: 0,\n                days: 2,\n                hours: 0,\n                minutes: 0,\n                seconds: 0,\n                isNegative: false\n            },\n            type: { recurring: false, edited: false },\n            createdAt: \"2017-01-24T15:33:04.000Z\"\n        }\n    }\n];\n```\n\n### scrapegoat.getAllEvents()\n\nFetches all events of the given calendar with data/details.\n\n### scrapegoat.getEventsByTime(start, end)\n\nFetch all events which occur between `start` and `end` (have to be valid [iCal Dates](http://www.kanzaki.com/docs/ical/dateTime.html)).\nIf you leave `start` and `end` out, you'll get all upcoming events from today.\nPassing only one date as a parameter returns all upcoming events from that date.\nThe end-date must be larger that the start-date.\n\nExample using [moment.js](http://momentjs.com/) for date formatting:\n\n```javascript\nconst moment = require(\"moment\");\n\nconst start = moment()\n    .startOf(\"month\")\n    .format(\"YYYYMMDD[T]HHmmss[Z]\");\nconst end = moment()\n    .endOf(\"month\")\n    .format(\"YYYYMMDD[T]HHmmss[Z]\");\n\nscrapegoat.getEventsByTime(start, end).then(console.log);\n```\n\nThe example below gets all events happening on a single day\n\n```javascript\nconst moment = require(\"moment\");\n\nconst start = moment(\"20170216T0000\").format(\"YYYYMMDD[T]HHmmss[Z]\");\nconst end = moment(\"20170216T2300\").format(\"YYYYMMDD[T]HHmmss[Z]\");\n\nscrapegoat.getEventsByTime(start, end).then(console.log);\n```\n\n## Sponsors\n\n[\u003cimg src=\"https://assets.peerigon.com/peerigon/logo/peerigon-logo-flat-spinat.png\" width=\"150\" /\u003e](https://peerigon.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerigon%2Fscrapegoat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeerigon%2Fscrapegoat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerigon%2Fscrapegoat/lists"}