module.exports = defineComponent({
props: {
rss: {
type: "app",
app: "rss",
}
},
async run({steps, $}) {
// Retrieve items from a sample feed
const Parser = require('rss-parser');
const parser = new Parser();
const stories = []
// Replace with your feed URL
const url = "https://pipedream.com/community/latest.rss"
const feed = await parser.parseURL(url);
const { title, items } = feed
this.title = title
if (!items.length) {
$end("No new stories")
}
this.items = items
},
})
export default defineComponent({
props: {
http: {
type: "http_request",
default: {
method: "GET",
url: "http://api.open-notify.org/iss-now.json",
}
}
},
async run({steps, $}) {
return await this.http.execute()
},
})