Skip to content

Commit abc2fb9

Browse files
authored
Merge pull request #62 from extractus/6.1.4
v6.1.4rc1
2 parents e9cb0a3 + b66c7e3 commit abc2fb9

File tree

19 files changed

+134
-132
lines changed

19 files changed

+134
-132
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
# Contributing to feed-reader
1+
# Contributing to `@extractus/feed-extractor`
22

3-
While `feed-reader` is just a simple library with personal purpose, I'm happy if it can be useful for you too.
3+
Glad to see you here.
44

5-
Anyway, I hope it always gets better, so pull requests are welcome, though larger proposals should be discussed first.
5+
Collaborations and pull requests are always welcomed, though larger proposals should be discussed first.
66

7-
As an OSS, it should follow the Unix philosophy: "do one thing and do it well".
7+
As an OSS, it's better to follow the Unix philosophy: "do one thing and do it well".
88

9-
## Installation
109

11-
- Ensure you have `node` and `npm` installed.
12-
- After cloning the repository, run `npm install` in the root of the repository.
13-
- Run `npm test` to ensure that everything works correctly in your environment.
10+
## What you can contribute?
1411

15-
If it works well, you can start modifying your fork.
12+
We are planing to re-write this tool in TypeScript and make it Deno-first library.
13+
If you are interested, please join our team.
1614

17-
In this process, you can use [`node eval.js` command](https://github.com/ndaidong/feed-reader#quick-evaluation) to evaluate your changes.
15+
Besides that, you can also:
16+
17+
- Test and report bugs
18+
- Fix unresolved issues
19+
- Improve performance
20+
- Write better documentation
21+
- Create examples or build demos
22+
- Feedback on software design and APIs
1823

1924

2025
## Third-party libraries
@@ -32,7 +37,7 @@ Make sure your code lints before opening a pull request.
3237

3338

3439
```bash
35-
cd feed-reader
40+
cd feed-extractor
3641

3742
# check coding convention issue
3843
npm run lint
@@ -49,18 +54,18 @@ npm run lint:fix
4954
Be sure to run the unit test suite before opening a pull request. An example test run is shown below.
5055

5156
```bash
52-
cd feed-reader
57+
cd feed-extractor
5358
npm test
5459
```
5560

56-
![feed-reader unit test](https://i.imgur.com/xTwZK6B.png)
61+
![feed-extractor unit test](https://i.imgur.com/xTwZK6B.png)
5762

5863
If test coverage decreased, please check test scripts and try to improve this number.
5964

6065

6166
## Documentation
6267

63-
If you've changed APIs, please update README and [the examples](https://github.com/ndaidong/feed-reader/tree/main/examples).
68+
If you've changed APIs, please update README and [the examples](https://github.com/extractus/feed-extractor/tree/main/examples).
6469

6570

6671
## Clean commit histories
@@ -79,6 +84,6 @@ For people new to git, please refer the following guides:
7984

8085
## License
8186

82-
By contributing to `feed-reader`, you agree that your contributions will be licensed under its [MIT license](https://github.com/ndaidong/feed-reader/blob/main/LICENSE).
87+
By contributing to `@extractus/feed-extractor`, you agree that your contributions will be licensed under its [MIT license](https://github.com/extractus/feed-extractor/blob/main/LICENSE).
8388

8489
---

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Dong Nguyen
3+
Copyright (c) 2015 Extractus
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
1-
# feed-reader
1+
# feed-extractor
22

33
To read & normalize RSS/ATOM/JSON feed data.
44

5-
[![NPM](https://badge.fury.io/js/feed-reader.svg)](https://badge.fury.io/js/feed-reader)
6-
![CI test](https://github.com/ndaidong/feed-reader/workflows/ci-test/badge.svg)
7-
[![Coverage Status](https://img.shields.io/coveralls/github/ndaidong/feed-reader)](https://coveralls.io/github/ndaidong/feed-reader?branch=main)
8-
![CodeQL](https://github.com/ndaidong/feed-reader/workflows/CodeQL/badge.svg)
5+
[![npm version](https://badge.fury.io/js/@extractus%2Ffeed-extractor.svg)](https://badge.fury.io/js/@extractus%2Ffeed-extractor)
6+
![CI test](https://github.com/extractus/feed-extractor/workflows/ci-test/badge.svg)
7+
[![Coverage Status](https://img.shields.io/coveralls/github/extractus/feed-extractor)](https://coveralls.io/github/extractus/feed-extractor?branch=main)
8+
![CodeQL](https://github.com/extractus/feed-extractor/workflows/CodeQL/badge.svg)
99
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
1010

1111
## Intro
1212

13-
*feed-reader* is a part of tool sets for content builder:
13+
*feed-extractor* is a part of tool sets for content builder:
1414

15-
- [feed-reader](https://github.com/ndaidong/feed-reader): extract & normalize RSS/ATOM/JSON feed
16-
- [article-parser](https://github.com/ndaidong/article-parser): extract main article from given URL
17-
- [oembed-parser](https://github.com/ndaidong/oembed-parser): extract oEmbed data from supported providers
15+
- [feed-extractor](https://github.com/extractus/feed-extractor): extract & normalize RSS/ATOM/JSON feed
16+
- [article-extractor](https://github.com/extractus/article-extractor): extract main article from given URL
17+
- [oembed-extractor](https://github.com/extractus/oembed-extractor): extract oEmbed data from supported providers
1818

1919
You can use one or combination of these tools to build news sites, create automated content systems for marketing campaign or gather dataset for NLP projects...
2020

21-
```
22-
┌────────────────┐
23-
┌───────► article-parser ├──────────┐
24-
│ └────────────────┘ │
25-
┌─────────────┐ ┌─────────┴────┐ ┌────────▼─────────┐ ┌─────────────┐
26-
│ feed-reader ├───► feed entries │ │ content database ├───► public APIs │
27-
└─────────────┘ └─────────┬────┘ └────────▲─────────┘ └─────────────┘
28-
│ ┌────────────────┐ │
29-
└───────► oembed-parser ├──────────┘
30-
└────────────────┘
31-
```
21+
### Attention
22+
23+
`feed-reader` has been renamed to `@extractus/feed-extractor` since v6.1.4
3224

3325
## Demo
3426

@@ -40,39 +32,43 @@ You can use one or combination of these tools to build news sites, create automa
4032
### Node.js
4133

4234
```bash
43-
npm i feed-reader
35+
npm i @extractus/feed-extractor
4436

4537
# pnpm
46-
pnpm i feed-reader
38+
pnpm i @extractus/feed-extractor
4739

4840
# yarn
49-
yarn add feed-reader
41+
yarn add @extractus/feed-extractor
5042
```
5143

5244
```ts
5345
// es6 module
54-
import { read } from 'feed-reader'
46+
import { read } from '@extractus/feed-extractor'
5547

5648
// CommonJS
57-
const { read } = require('feed-reader')
49+
const { read } = require('@extractus/feed-extractor')
5850

5951
// or specify exactly path to CommonJS variant
60-
const { read } = require('feed-reader/dist/cjs/feed-reader.js')
52+
const { read } = require('@extractus/feed-extractor/dist/cjs/feed-extractor.js')
6153
```
6254

6355
### Deno
6456

6557
```ts
66-
import { read } from 'https://esm.sh/feed-reader'
58+
// deno > 1.28
59+
import { read } from 'npm:@extractus/feed-extractor'
60+
61+
// deno < 1.28
62+
// import { read } from 'https://esm.sh/@extractus/feed-extractor'
6763
```
6864

6965
### Browser
7066

7167
```ts
72-
import { read } from 'https://unpkg.com/feed-reader@latest/dist/feed-reader.esm.js'
68+
import { read } from 'https://unpkg.com/@extractus/feed-extractor@latest/dist/feed-extractor.esm.js'
7369
```
7470

75-
Please check [the examples](https://github.com/ndaidong/feed-reader/tree/main/examples) for reference.
71+
Please check [the examples](https://github.com/extractus/feed-extractor/tree/main/examples) for reference.
7672

7773
### Deta cloud
7874

@@ -110,9 +106,10 @@ Feed content must be accessible and conform one of the following standards:
110106
For example:
111107

112108
```js
113-
import { read } from 'feed-reader'
109+
import { read } from '@extractus/feed-extractor'
114110

115-
read('https://news.google.com/atom').then(result => console.log(result))
111+
const result = await read('https://news.google.com/atom')
112+
console.log(result)
116113
```
117114

118115
Without any options, the result should have the following structure:
@@ -151,13 +148,13 @@ Object with all or several of the following properties:
151148
For example:
152149

153150
```ts
154-
import { read } from 'feed-reader'
151+
import { read } from '@extractus/feed-extractor'
155152

156-
read('https://news.google.com/atom', {
153+
await read('https://news.google.com/atom', {
157154
useISODateFormat: false
158155
})
159156

160-
read('https://news.google.com/rss', {
157+
await read('https://news.google.com/rss', {
161158
useISODateFormat: false,
162159
getExtraFeedFields: (feedData) => {
163160
return {
@@ -191,10 +188,10 @@ You can use this param to set request headers to fetch.
191188
For example:
192189

193190
```js
194-
import { read } from 'feed-reader'
191+
import { read } from '@extractus/feed-extractor'
195192

196193
const url = 'https://news.google.com/rss'
197-
read(url, null, {
194+
await read(url, null, {
198195
headers: {
199196
'user-agent': 'Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1'
200197
}
@@ -206,11 +203,11 @@ You can also specify a proxy endpoint to load remote content, instead of fetchin
206203
For example:
207204

208205
```js
209-
import { read } from 'feed-reader'
206+
import { read } from '@extractus/feed-extractor'
210207

211208
const url = 'https://news.google.com/rss'
212209

213-
read(url, null, {
210+
await read(url, null, {
214211
headers: {
215212
'user-agent': 'Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1'
216213
},
@@ -223,14 +220,14 @@ read(url, null, {
223220
})
224221
```
225222

226-
Passing requests to proxy is useful while running `feed-reader` on browser. View `examples/browser-feed-reader` as reference example.
223+
Passing requests to proxy is useful while running `@extractus/feed-extractor` on browser. View `examples/browser-feed-reader` as reference example.
227224

228225

229226
## Quick evaluation
230227

231228
```bash
232-
git clone https://github.com/ndaidong/feed-reader.git
233-
cd feed-reader
229+
git clone https://github.com/extractus/feed-extractor.git
230+
cd feed-extractor
234231
npm install
235232

236233
node eval.js --url=https://news.google.com/rss --normalization=y --useISODateFormat=y --includeEntryContent=n --includeOptionalElements=n

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Description above is a general rule and may be altered on case by case basis.
1212

1313
You can report low severity vulnerabilities as GitHub issues.
1414

15-
More severe vulnerabilities should be reported to my email [email protected] or Twitter [@ndaidong](https://twitter.com/ndaidong).
15+
More severe vulnerabilities should be reported to email extractus.security@skiff.com.
1616

1717
---

build.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/**
2-
* build.js
3-
* @ndaidong
4-
**/
1+
// build.js
52

63
import { readFileSync, writeFileSync, copyFileSync, rmSync, mkdirSync } from 'fs'
74

@@ -38,7 +35,7 @@ const esmVersion = {
3835
...baseOpt,
3936
platform: 'browser',
4037
format: 'esm',
41-
outfile: `dist/${pkg.name}.esm.js`,
38+
outfile: 'dist/feed-extractor.esm.js',
4239
banner: {
4340
js: comment
4441
}
@@ -50,7 +47,7 @@ const cjsVersion = {
5047
platform: 'node',
5148
format: 'cjs',
5249
mainFields: ['main'],
53-
outfile: `dist/cjs/${pkg.name}.js`,
50+
outfile: 'dist/cjs/feed-extractor.js',
5451
banner: {
5552
js: comment
5653
}

build.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99

1010
const pkg = JSON.parse(readFileSync('./package.json'))
1111

12-
const esmFile = `./dist/${pkg.name}.esm.js`
13-
const cjsFile = `./dist/cjs/${pkg.name}.js`
12+
const esmFile = './dist/feed-extractor.esm.js'
13+
const cjsFile = './dist/cjs/feed-extractor.js'
1414
const cjsPkg = JSON.parse(readFileSync('./dist/cjs/package.json'))
1515
const cjsType = './dist/cjs/index.d.ts'
1616

0 commit comments

Comments
 (0)