Hackernews Reader uses http-source to build an XML reader that ingests hackernews articles, converts them to json
, divides them into records, and publishes each record to a topic.
Show an example on how to query XML RSS feeds and convert each article into an individual JSON event for downstream processing.
- Fluvio CLI running locally
- Account on InfinyOn Cloud
Create an HTTP source connector configuration file called hackernews.yaml
:
apiVersion: 0.1.0
meta:
version: 0.3.6
name: hackernews
type: http-source
topic: hackernews
http:
method: GET
endpoint: 'https://hnrss.org/newest'
interval: 600s
transforms:
- uses: infinyon-labs/[email protected]
- uses: infinyon/[email protected]
with:
spec:
- operation: shift
spec:
items: ""
- uses: infinyon-labs/[email protected]
Download the smartmodules used by the connectors to your cluster:
fluvio hub sm download infinyon/[email protected]
fluvio hub sm download infinyon-labs/[email protected]
fluvio hub sm download infinyon-labs/[email protected]
Check fluvio smartmodule list
to ensure they've been downloaded.
fluvio cloud connector create --config hackernews.yaml
Connector logs:
fluvio cloud connector log hackernews
Records produced:
fluvio consume hackernews -T 10
- How to Stream and Transform Data from Hacker News RSS Feed (YouTube Video)
- labs-rss-json-sm
- labs-array-map-json-sm