Welcome
Awesome Dat
Dat Applications
datproject/dat
datproject/dat-desktop
Community Applications
codeforscience/sciencefair
mafintosh/hyperirc
jondashkyle/soundcloud-archiver
mafintosh/hypervision
joehand/hypertweet
beakerbrowser/dat-photos-app
High-Level APIs
datproject/dat-node
datproject/dat-js
beakerbrowser/pauls-dat-api
beakerbrowser/node-dat-archive
Hosting & Dat Management
mafintosh/hypercore-archiver
datprotocol/hypercloud
beakerbrowser/hashbase
joehand/dat-now
mafintosh/hypercore-archiver-bot
joehand/hypercore-archiver-ws
datproject/dat-registry-api
datproject/dat-registry-client
Managing & Aggregating Dats
datproject/multidat
datproject/multidrive
jayrbolton/dat-pki
beakerbrowser/injestdb
Http Hosting
joehand/hyperdrive-http
beakerbrowser/dathttpd
Dat Link Utilties
datprotocol/dat-dns
joehand/dat-link-resolve
pfrazee/parse-dat-url
juliangruber/dat-encoding
Dat Utilities
joehand/dat-log
mafintosh/dat-ls
karissa/hyperhealth
joehand/hyperdrive-network-speed
File Imports & Exports
juliangruber/hyperdrive-import-files
mafintosh/mirror-folder
pfrazee/hyperdrive-staging-area
pfrazee/hyperdrive-to-zip-stream
Hypercore Tools
mafintosh/hyperpipe
Dat Core Modules
mafintosh/hyperdrive
mafintosh/hypercore
CLI Utilities
joehand/dat-doctor
joehand/dat-ignore
joehand/dat-json
Networking
karissa/hyperdiscovery
mafintosh/discovery-swarm
mafintosh/webrtc-swarm
joehand/dat-swarm-defaults
Lower level networking modules
maxogden/discovery-channel
mafintosh/dns-discovery
mafintosh/multicast-dns
webtorrent/bittorrent-dht
mafintosh/utp-native
mafintosh/signalhub
Storage
datproject/dat-storage
datproject/dat-secret-storage
Random Access
juliangruber/abstract-random-access
mafintosh/multi-random-access
mafintosh/random-access-file
mafintosh/random-access-memory
mafintosh/random-access-page-files
datproject/dat-http
substack/random-access-idb
Other Related Dat Project Modules
mafintosh/peer-network
mafintosh/hyperdht
Dat Project Organization Stuff
datproject/datproject.org
datproject/discussions
datproject/design
datproject/dat-elements
kriesse/dat-colors
kriesse/dat-icons
juliangruber/dat.json
Outdated
juliangruber/dat.haus
poga/hyperfeed
yoshuawuyts/normcore
yoshuawuyts/github-to-hypercore
poga/hyperspark
juliangruber/hypercore-index
juliangruber/hyperdrive-encoding
mafintosh/hyperdrive-http-server
joehand/hyperdrive-http
joehand/dat-push
joehand/dat-backup
joehand/archiver-server
joehand/archiver-api
poga/hyperdrive-ln
substack/hyperdrive-multiwriter
substack/hyperdrive-named-archives
substack/git-dat
CfABrigadePhiladelphia/jawn
maxogden/dat-archiver
juliangruber/hyperdrive-stats
karissa/hypercore-stats-server
mafintosh/hypercore-stats-ui
karissa/zip-to-hyperdrive
joehand/url-dat
joehand/tar-dat
joehand/hyperdrive-duplicate

Hyperfeed

NPM Version JavaScript Style Guide

Hyperfeed is a self-archiving P2P live feed. You can convert any RSS/ATOM/RDF feed to a P2P live update publishing network.

  • Self-archiving: Items and it's linked page will be archived within hyperfeed.
  • Decentralized: Feed contents can still be distributed between readers even if the original host is down.
  • Live: No need to poll the original feed. Updates will be pushed to you.
npm install hyperfeed

Synopsis

Publish your RSS feed through hyperfeed:

const request = require('request')
const hyperfeed = require('hyperfeed')
const hyperdrive = require('hyperdrive')
const swarm = require('hyperdiscovery')

const url = 'https://medium.com/feed/google-developers'

var archive = hyperdrive('./feed')
var feed = hyperfeed(archive)
feed.ready(() => {
  swarm(archive)
  console.log(feed.key.toString('hex'))
  feed.update(request(url), (err) => {
    console.log('feed imported')
  })
})

Now you can replicate the hyperfeed through a p2p network:

const Hyperfeed = require('hyperfeed')
const swarm = require('hyperdiscovery')
const hyperdrive = require('hyperdrive')

var archive = hyperdrive('./anotherFeed', '<KEY FROM ABOVE>')
var feed = hyperfeed(archive)
swarm(archive) // load the feed from the p2p network
feed.list((err, entries) => {
  console.log(entries) // all entries in the feed (include history entries)
})

API

var feed = hyperfeed(archive, [opts])

Create a new Hyperfeed instance. opts includes:

{
  scrapLink: true // set to false to stop archiving linked page for each feed item
}

feed.key

The public key identifying the feed.

feed.discoveryKey

A key derived from the public key that can be used to discovery other peers sharing this feed.

feed.meta

The metadata of the feed.

feed.ready(cb)

Wait for feed is fully ready and all properties has been populated.

feed.update(feedStream, cb(err, feed))

import a RSS feed into feed. Accept a stream.

feed.setMeta(metadataObject, cb(err))

Set feed's metadata.

feed.list(cb(err, entries))

List archived item in the feed.

feed.save(item, [scrappedData], cb(err))

Save a new feed item. Check https://github.com/jpmonette/feed for item detail.

If you already have scrapped data for the given item, you can pass it to scrappedData to avoid redundant requests.

feed.export(count, cb(err, rss))

Export a RSS-2.0 Feed containing latest count items.

License

The MIT License