https://github.com/vxern/dexonline-scraper
🇷🇴 A performant, battle-tested scraper for dexonline.ro to fetch information about words in the Romanian language.
https://github.com/vxern/dexonline-scraper
battle-tested definitions dexonline dictionary etymology examples expressions inflection javascript language node parser romanian scraper typescript
Last synced: 5 months ago
JSON representation
🇷🇴 A performant, battle-tested scraper for dexonline.ro to fetch information about words in the Romanian language.
- Host: GitHub
- URL: https://github.com/vxern/dexonline-scraper
- Owner: vxern
- License: mit
- Created: 2023-06-21T19:57:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T22:12:48.000Z (8 months ago)
- Last Synced: 2025-05-08T19:50:13.630Z (5 months ago)
- Topics: battle-tested, definitions, dexonline, dictionary, etymology, examples, expressions, inflection, javascript, language, node, parser, romanian, scraper, typescript
- Language: TypeScript
- Homepage: https://npmjs.com/package/dexonline-scraper
- Size: 167 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## A tiny, battle-tested, performant and documented scraper for dexonline.ro.
### Usage
To start using the scraper, first install it using the following command:
```ts
npm install dexonline-scraper
```The simplest way of using the scraper is as follows:
```ts
import * as Dexonline from "dexonline-scraper";const results = await Dexonline.get("word");
```Alternatively, you can parse HTML of the website directly, bypassing the fetch
step as follows. Notice that, as opposed to `get()`, `parse()` is synchronous:```ts
import * as Dexonline from "dexonline-scraper";const results = Dexonline.parse(html);
```You can configure the mode according to which the parser will match results to
the search term, ensuring that only terms identical to the search term are
returned:```ts
import * as Dexonline from "dexonline-scraper";const results = await Dexonline.get("word", { mode: "strict" });
```You can modify the results returned by Dexonline using flags:
```ts
import * as Dexonline from 'dexonline-scraper';
import { DictionaryFlags } from 'dexonline-scraper';const results = await Dexonline.get('word', {
flags:
| DictionaryFlags.UseCedillas // Use 'ÅŸ' and 'Å£' instead of 'È™' and 'È›'.
| DictionaryFlags.MatchDiacritics // Do not return words where the only difference is a diacritic.
| DictionaryFlags.UsePreReformOrthography // Use 'î' instead of 'â' in all cases except for the word 'român' and its derivatives.
| DictionaryFlags.SearchOnlyNormativeDictionaries // Return results obtained only from the DEX and/or the DOOM.
});
```