Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@synonymdev/slashtags-widget-news-feed

Package Overview
Dependencies
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synonymdev/slashtags-widget-news-feed

A slashtags widget with recent news.

latest
npmnpm
Version
1.1.0
Version published
Maintainers
7
Created
Source

slashtags-widget-news-feed

A slashtags widget with recent news.

Usage

Feed

Copy config/config.example.json to config/config.json then edit the relay address.

cp config/config.example.json config/config.json

Start the feed writer

npm start

It will generate a keyPair and persist that in config/config.json for future sessions.

It should print: Running Bitcoin news feed: slashfeed:<id>/Bitcoin Headlines?relay=<relay-address>

Reader

To read The news feed use the Reader helper class.

const { Feed, Reader } = require('slashtags-widget-news-feed')

(async () => {
  const client = new Client({ storage: './path/to/feed/storage', relay: 'https://web-relay.example.com' })
  const feed = new Feed(client, config, { icon })

  await feed.ready() 

  const client = new Client({ storage: './path/to/reader/storage'})

  const readerClient = new Client({ storage: tmpdir() })
  const reader = new Reader(readerClient, feed.url)

  const latestArticle = await reader.getLatestArticle()
  // {
  //   title: 'Article Title',
  //   link: 'https://example.com/article-x',
  //   published: 1692255625871,
  //   publisher: { title: 'Feed Bar', link: 'bar.example.com' }
  // }
})

FAQs

Package last updated on 05 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts