I would like to try send medium's post links into discord channel. However i didn't find much resources online. I found some SDK library but that really seems to be outdated https://www.npmjs.com/package/medium-sdk
. It is possible to use Medium API somehow to send medium post from certain "user" as a medium post website link to the defined discord channel?
Not sure if someone ever did this. I only saw a posibility to create a medium post when a discord message is sent to the channel somehow. But that's not what I'm looking for.
Asked
Active
Viewed 645 times
3

Daniel Widdis
- 8,424
- 13
- 41
- 63

RasmonT
- 391
- 2
- 13
-
3Are you looking for how to have a Discord message sent when a Medium user posts a new article? – user15517071 Sep 09 '21 at 04:11
-
@user15517071 Exactly! – RasmonT Sep 09 '21 at 14:58
2 Answers
1
You can use this package: feed-watcher, and set the feed to https://medium.com/feed/@the_writer_name
.

TylerH
- 20,799
- 66
- 75
- 101

Milo Moisson
- 119
- 1
- 10
-
Hello there! I tried to implement it, however i do not get any updates on new feed and i have weird error on startup ( i will receive some data only on startup of the script) `node test.js Error: Invalid URI "rasmont.medium.com/feed?unit=second&interval=5"` – RasmonT Sep 12 '21 at 00:19
-
I have one problem https://stackoverflow.com/questions/69147878/discord-js-medium-integration-via-feed-watcher-cant-get-feed-link-from-the-upd . I don't know how to take data from the response so i can use them. – RasmonT Sep 12 '21 at 01:51
0
This way, you can get medium posts from the feed-watcher and then send link from the medium post to the discord channel. (Feed is updating approx each 15-20 minutes.) So there might be a delay once medium post is posted to receive data from feed to send link to the channel.
'use strict';
//define your medium link in the feed
var Watcher = require('feed-watcher'),
feed = "https://yourmedium.medium.com/feed?unit=second&interval=5",
interval = 10 // seconds
var watcher = new Watcher(feed, interval)
// Require the necessary discord.js classes
const { Client, Intents } = require('discord.js');
const config = require("./configtest.json");
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.on('ready', () => {
watcher.on('new entries', function (entries) {
entries.forEach(function (entry) {
const stringifylink = JSON.stringify(entry)
const link = JSON.parse(stringifylink)
console.log('FEED Call response:', link);
console.log('Link:', link.link)
//send new medium post link to the defined discord channel.
client.guilds.cache.forEach(guild => {
let channel = guild.channels.cache.get('ChannelID')
channel.send('Check out our new medium post! ' + link.link)
})
})
})
watcher
.start()
.then(function (entries) {
console.log(entries)
})
.catch(function(error) {
console.error(error)
})
})
// Login to Discord with your client's token
client.login(config.token);

RasmonT
- 391
- 2
- 13