GitXplorerGitXplorer
j

hypertweet

public
71 stars
7 forks
0 issues

Commits

List of commits on branch master.
Verified
45885febe667ddf38ebc4c90605adbd700ea1116

0.3.0

jjoehand committed 8 years ago
Verified
59069d002081703adc322d0d408255edb9d2cf5b

add stream opts

jjoehand committed 8 years ago
Verified
2a166b45bbc5d3baad35b37d3b074e46c1a1762a

0.2.0

jjoehand committed 8 years ago
Verified
fb2bc9eecdc809f1099ee6d2dc57515b292ec4ba

add streaming url to opts

jjoehand committed 8 years ago
Verified
e1987be7b8bd403fb6ca33d5302928b7f0a9f7b2

0.1.0

jjoehand committed 8 years ago
Verified
8320496dfc45251d32a07de0181abb04d5eef14d

callback w/ feed

jjoehand committed 8 years ago

README

The README file for this repository.

hypertweet

Proof of concept Twitter + Dat feed stream thingy.

Streams your twitter feed to a hypercore feed. Pretty print your feed or stream it anywhere with hyperpipe.

hypertweet

Install

npm install -g hypertweet

hypertweet --help # see help!

Set twitter tokens

Get Twitter developer key and either set them as environment variables or copy .sample.env to .env file.

process.env.TWITTER_CONSUMER_KEY,
process.env.TWITTER_CONSUMER_SECRET
process.env.TWITTER_ACCESS_TOKEN_KEY,
process.env.TWITTER_ACCESS_TOKEN_SECRET

Usage

Use hypertweet --help to see all the options.

Collect Feed Data

Streams your feed into a hypercore feed:

❯ hypertweet --dir=/joe/my-twitter-data/
sharing 0c3ec59a8111fde379e7ef82e6610ec02daf6bd3b704f41554cd5fe76afd5cc4

2017-04-21T02:20:24.205Z tweet by: 'some twitter user'
2017-04-21T02:20:25.000Z tweet by: 'more chirps'
2017-04-21T02:20:30.043Z tweet by: 'asdf'

Print anywhere

Pretty print it in another terminal (or another computer anywhere):

❯ hypertweet 0c3ec59a8111fde379e7ef82e6610ec02daf6bd3b704f41554cd5fe76afd5cc4

# pretty tweets here

Or pipe

Pipe anywhere to anything.

npm install -g hyperpipe
hyperpipe /db 0c3ec59a8111fde379e7ef82e6610ec02daf6bd3b704f41554cd5fe76afd5cc4 > data.json

API

hypertweet(dir|storage, [opts], callback(err, feed))

Create a stream from the twitter API and share via hypercore feed. Automatically joins network via discovery-swarm.

  • dir|storage: directory or random access module, e.g random-access-memory.
  • opts.streamUrl: the twitter streaming api endpoint you want. defaults to user.
  • opts.streamOpts: stream opts

License

MIT