Last active
April 17, 2017 15:24
-
-
Save bupkes/74212176f7375d84833e8c10fa49e4c0 to your computer and use it in GitHub Desktop.
rss to mastodon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Masto = require('mastodon'); | |
var FeedSub = require('feedsub'); | |
var striptags = require('striptags'); | |
var M = new Masto({ | |
access_token: 'YOUR ACCESS TOKEN', | |
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests. | |
api_url: 'https://mastodon.social/api/v1/', // optional, defaults to https://mastodon.social/api/v1/ put your own in obvs | |
}); | |
var reader = new FeedSub('INSERT RSS FEED HERE.rss', { | |
interval: 1, // check feed every 1 minutes | |
emitOnStart: true | |
}); | |
reader.on('item', function(item) { | |
M.post('statuses', { status: striptags(item.description)}); | |
}); | |
reader.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment