Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdehaan/blurts-wordcloud
Scans the specified email using the HIBP API and calculates the data class frequency.
https://github.com/pdehaan/blurts-wordcloud
Last synced: 17 days ago
JSON representation
Scans the specified email using the HIBP API and calculates the data class frequency.
- Host: GitHub
- URL: https://github.com/pdehaan/blurts-wordcloud
- Owner: pdehaan
- Created: 2019-06-21T06:05:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T00:49:55.000Z (about 2 years ago)
- Last Synced: 2024-12-01T22:13:02.226Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 421 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blurts-wordcloud
Scans the specified email using the [HIBP API](https://haveibeenpwned.com/API/) and calculates the data class frequency.
**NOTE:** This script only generates an array of word and frequency pairs. If you want to _graph_ the word cloud, you'll need to do something like https://codepen.io/anon/pen/pXROmy.
## Usage
### CLI
```sh
npx @pdehaan/blurts-wordcloud [email protected]
```### API
```js
// `npm i @pdehaan/blurts-wordcloud -S`
const lib = require("@pdehaan/blurts-wordcloud");async function main() {
const breaches = await lib.scan("[email protected]");
const wordfreq = await lib.dataClassFrequency(breaches);
console.log(JSON.stringify(wordfreq, null, 2));
}main();
```## Output
```js
[
{ word: 'Email addresses', freq: 5 },
{ word: 'Names', freq: 2 },
{ word: 'Phone numbers', freq: 2 },
{ word: 'Passwords', freq: 2 },
{ word: 'Employers', freq: 1 },
{ word: 'Geographic locations', freq: 1 },
{ word: 'Job titles', freq: 1 },
{ word: 'Salutations', freq: 1 },
{ word: 'Social media profiles', freq: 1 },
{ word: 'Device information', freq: 1 },
{ word: 'Physical addresses', freq: 1 },
{ word: 'Purchases', freq: 1 }
]
```