https://github.com/elsehow/kefir-periodic-get
periodically poll a URL, and get a kefir stream of responses.
https://github.com/elsehow/kefir-periodic-get
Last synced: over 1 year ago
JSON representation
periodically poll a URL, and get a kefir stream of responses.
- Host: GitHub
- URL: https://github.com/elsehow/kefir-periodic-get
- Owner: elsehow
- Created: 2015-10-11T07:55:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-11T07:55:32.000Z (over 10 years ago)
- Last Synced: 2025-03-02T05:49:57.899Z (over 1 year ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kefir-periodic-get
periodically poll a URL, and get a kefir stream of responses.
works in node and the browser!
## installation
`npm install kefir-periodic-get`
## usage
poll for recent changes on wikipedia:
```javascript
var kefir-periodic-get = require('timesink')
var wikiRecentlyChanged = 'https://en.wikipedia.org/wiki/Special:RecentChanges'
var syncedTimes = kefir-periodic-get(wikiRecentlyChanged, 1000).skipDuplicates()
```
this will issue a GET to the `wikiRecentlyChanged` every 1000ms.
## api
`kefir-periodic-get(url, interval)`
issues a GET request to `url` every `interval` ms.
returns a kefir stream of responses.