https://github.com/hackergrrl/twitter-kv
:bird: Key-value store over twitter user feeds
https://github.com/hackergrrl/twitter-kv
Last synced: 9 months ago
JSON representation
:bird: Key-value store over twitter user feeds
- Host: GitHub
- URL: https://github.com/hackergrrl/twitter-kv
- Owner: hackergrrl
- Created: 2016-04-30T23:48:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-12T15:58:53.000Z (about 10 years ago)
- Last Synced: 2024-12-28T21:45:45.468Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 13
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twitter-kv
> Short lived key-value store using Twitter user feeds.
## Background
Sometimes you'd like to store a simple (key, value) mapping for a short time
using a service that's already running and is highly available -- like Twitter.
*No access tokens required!*
Since HTTP scraping is used under the hood in
[`latest-tweets`](https://github.com/noffle/latest-tweets), only the last couple
dozen tweets will be available, making this ideal for use as a transient store.
## Usage
```js
var resolve = require('twitter-kv')
resolve('noffle', 'test', function (err, value) {
if (err) return console.log(err)
console.log('value:', value)
})
```
This will look for a recent tweet in my timeline of the format
```
key = value
```
If it finds it -- let's say I have a tweet that says `foo = bar` -- I can expect
the following output
```
value: bar
```
## API
```js
var twitterKv = require('twitter-kv')
```
### resolve(user, key, cb)
Queries the twitter user feed for `user`, looking for an entry of the form `key
= value`. Calls `cb(err, value)` with the most recent value for `key`. Expect
`key` to be `null` if no value was found.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install twitter-kv
```
## See Also
- [latest-tweets](https://github.com/noffle/latest-tweets)
## License
ISC