You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
654 B
26 lines
654 B
7 months ago
|
import { XMLParser } from 'fast-xml-parser'
|
||
|
import Action from './../../packages/runner/actions/action.ts'
|
||
|
|
||
|
/**
|
||
|
* getting rss feed from url, parse response and send to console
|
||
|
*
|
||
|
* @author Björn Hase <me@herr-hase.wtf>
|
||
|
* @license http://opensource.org/licenses/MIT The MIT License
|
||
|
* @link https://git.node001.net/HerrHase/super-hog.git
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
class RssExample extends Action {
|
||
|
async run() {
|
||
|
const response = await fetch(this.config.url)
|
||
|
const body = await response.text()
|
||
|
|
||
|
const parser = new XMLParser()
|
||
|
this.result = parser.parse(body)
|
||
|
|
||
|
console.log(this.result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default RssExample
|