npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

podping-client

v3.2.2

Published

A client for reading from the Hive blockchain and pulling out [podping.cloud](https://podping.cloud/) transactions. This is designed to only work under node, but should be able to support the browser with changes if the need arises.

Downloads

11

Readme

podping-client

A client for reading from the Hive blockchain and pulling out podping.cloud transactions. This is designed to only work under node, but should be able to support the browser with changes if the need arises.

This client produces RxJS observables but that can be completely transparent to you as a consumer. You simply need to import/require the *Stream$ function, call it with a duration (hours, minutes, seconds back to start checking the blockchain from) or starting block number, and call .subscribe to get events.

This package is also using pino for logging and the log level can be configured via process.env.LOG, by default warn level logging will be produced for NODE_ENV=production and info for all other environments.

Install

yarn add podping-client
npm install podping-client

Usage

When an error or end event occurs with the blockchain stream, it will attempt to recreate the stream transparently for the consumer if the following evaluates to true

process.env.NODE_ENV === "production" || Boolean(process.env.IGNORE_END),
const { getTransactionStream$ } = require("podping-client");

// Get a RxJS stream of transactions starting from 5 minutes ago
// Once subscribed, the callback will be called for every transaction
getTransactionStream$({ minutes: 5 }).subscribe((block) => {
  console.log(block);
  // {
  //   blocktime: 2021-09-29T14:03:24.000Z,
  //   block_id: '0372b4b6a33995e35427d4a4dec9ae4132981550',
  //   block_num: 57849014,
  //   payload_id: 'podping',
  //   posting_auth: 'podping.aaa',
  //   version: '0.3',
  //   num_urls: 5,
  //   reason: 'feed_update',
  //   urls: [
  //     'https://feeds.buzzsprout.com/1842728.rss',
  //     'https://feeds.buzzsprout.com/1588819.rss',
  //     'https://feeds.buzzsprout.com/265419.rss',
  //     'https://feeds.buzzsprout.com/1710223.rss',
  //     'https://feeds.buzzsprout.com/1776249.rss'
  //   ]
  // }
});
const { getStream$ } = require("podping-client");

// Get a RxJS stream of urls starting from 15 minutes ago (default)
// Once subscribed, the callback will be called for every url
getStream$().subscribe((block) => {
  console.log(block);
  // {
  //   url: 'https://media.rss.com/painintopurpose/feed.xml',
  //   blocktime: 2021-09-29T14:04:30.000Z,
  //   block_id: '0372b4ccc636fd90229fc88212ea29bf4d30f482',
  //   block_num: 57849036,
  //   payload_id: 'podping',
  //   posting_auth: 'podping.aaa',
  //   version: '0.3',
  //   num_urls: 4,
  //   reason: 'feed_update'
  // }
  // {
  //   url: 'https://feeds.buzzsprout.com/1117766.rss',
  //   blocktime: 2021-09-29T14:04:30.000Z,
  //   block_id: '0372b4ccc636fd90229fc88212ea29bf4d30f482',
  //   block_num: 57849036,
  //   payload_id: 'podping',
  //   posting_auth: 'podping.aaa',
  //   version: '0.3',
  //   num_urls: 4,
  //   reason: 'feed_update'
  // }
  // {
  //   url: 'https://feeds.buzzsprout.com/1830336.rss',
  //   blocktime: 2021-09-29T14:04:30.000Z,
  //   block_id: '0372b4ccc636fd90229fc88212ea29bf4d30f482',
  //   block_num: 57849036,
  //   payload_id: 'podping',
  //   posting_auth: 'podping.aaa',
  //   version: '0.3',
  //   num_urls: 4,
  //   reason: 'feed_update'
  // }
  // {
  //   url: 'https://media.rss.com/tes6071/feed.xml',
  //   blocktime: 2021-09-29T14:04:30.000Z,
  //   block_id: '0372b4ccc636fd90229fc88212ea29bf4d30f482',
  //   block_num: 57849036,
  //   payload_id: 'podping',
  //   posting_auth: 'podping.aaa',
  //   version: '0.3',
  //   num_urls: 4,
  //   reason: 'feed_update'
  // }
});