Last active
May 16, 2018 00:50
-
-
Save dannyrb/d9422517f78f1d79728f28174ce789f9 to your computer and use it in GitHub Desktop.
Quick way to retrieve a Medium.com RSS feed as JSON
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
import axios from "axios"; | |
async function getMediumFeed() { | |
try { | |
const mediumRssFeed = "https://medium.com/feed/coffee-driven-dev"; | |
const rssToJsonApi = "https://api.rss2json.com/v1/api.json"; | |
const data = { params: { rss_url: mediumRssFeed } }; | |
return await axios.get(rssToJsonApi, data); | |
} catch (error) { | |
console.error(error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment