Real Simple Syndication
The RSS app allows users to automatically fetch and parse updates from web feeds. This functionality is pivotal for staying abreast of content changes or updates from websites, blogs, and news outlets that offer RSS feeds. With Pipedream, you can harness the RSS API to trigger workflows that enable a broad range of automations, like content aggregation, monitoring for specific keywords, notifications, and data synchronization across platforms.
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
},
})
QStash API offers a secure, scalable, and simple way to manage message queues and defer tasks. Using this API, you can enqueue messages, schedule tasks to run after a delay, and ensure that tasks are executed exactly once, leveraging the power of serverless architecture. With Pipedream's ability to connect to a multitude of services, you can build complex workflows that trigger actions in other apps based on events in QStash, allowing you to automate cross-application business processes with ease.
import { axios } from '@pipedream/platform';
export default defineComponent({
props: {
qstash: {
type: "app",
app: "qstash",
},
callback_url: {
type: "string",
label: "Callback URL",
description: "A URL that will be called by QStash with the body given",
},
delay: {
type: "string",
label: "Delay",
default: 0,
description: "Delay the HTTP request to the callback URL (seconds)"
}
},
async run({steps, $}) {
return axios($, {
url: `https://qstash.upstash.io/v1/publish/${this.callback_url}`,
method: 'POST',
headers: {
'Authorization': `Bearer ${this.qstash.auth.qstash_token}`,
'Upstash-Delay': `${this.qstash.delay}s`
},
data: {
hello: 'world'
}
});
}
})