Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/rss/actions/merge-rss-feeds/merge-rss-feeds.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import rss from "../../app/rss.app";
import { defineAction } from "@pipedream/types";
import rss from "../../app/rss.app";

export default defineAction({
name: "Merge RSS Feeds",
description: "Retrieve multiple RSS feeds and return a merged array of items sorted by date [See documentation](https://www.rssboard.org/rss-specification)",
key: "rss-merge-rss-feeds",
version: "1.2.8",
version: "1.2.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
13 changes: 7 additions & 6 deletions components/rss/app/rss.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineApp({
},
methods: {
// in theory if alternate setting title and description or aren't unique this won't work
itemTs(item = {} as (Item | any)): number {
itemTs(item = {} as (Item | any)): number { // eslint-disable-line @typescript-eslint/no-explicit-any
const {
pubdate, pubDate, date_published,
} = item;
Expand All @@ -40,7 +40,7 @@ export default defineApp({
}
return +new Date();
},
itemKey(item = {} as (Item | any)): string {
itemKey(item = {} as (Item | any)): string { // eslint-disable-line @typescript-eslint/no-explicit-any
const {
id, guid, link, title,
} = item;
Expand All @@ -53,12 +53,13 @@ export default defineApp({
}
return hash(item);
},
async fetchFeed(url: string): Promise<any> {
async fetchFeed(url: string): Promise<any> { // eslint-disable-line @typescript-eslint/no-explicit-any
const res = await axios(this, {
url,
method: "GET",
headers: {
"accept": "text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8, application/json, application/feed+json",
"User-Agent": "@PipedreamHQ/pipedream v1.0",
},
validateStatus: () => true, // does not throw on any bad status code
responseType: "stream", // stream is required for feedparser
Expand Down Expand Up @@ -86,7 +87,7 @@ export default defineApp({
feedparser.on("error", reject);
feedparser.on("end", resolve);
feedparser.on("readable", function (this: FeedParser) {
let item: any = this.read();
let item: any = this.read(); // eslint-disable-line @typescript-eslint/no-explicit-any

while (item) {
/*
Expand Down Expand Up @@ -119,7 +120,7 @@ export default defineApp({
});
return items;
},
isJSONFeed(response: any): boolean {
isJSONFeed(response: any): boolean { // eslint-disable-line @typescript-eslint/no-explicit-any
const acceptedJsonFeedMimes = [
"application/feed+json",
"application/json",
Expand Down Expand Up @@ -156,7 +157,7 @@ export default defineApp({
return url;
},
sortItems(items) {
return items.sort((itemA: any, itemB: any) => {
return items.sort((itemA: any, itemB: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (this.itemTs(itemA) > this.itemTs(itemB)) {
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion components/rss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/rss",
"version": "0.5.8",
"version": "0.5.9",
"description": "Pipedream RSS Components",
"main": "dist/app/rss.app.mjs",
"types": "dist/app/rss.app.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rss from "../../app/rss.app";
import { defineSource } from "@pipedream/types";
import rss from "../../app/rss.app";
import rssCommon from "../common/common";

export default defineSource({
Expand All @@ -8,7 +8,7 @@ export default defineSource({
name: "New Item From Multiple RSS Feeds",
type: "source",
description: "Emit new items from multiple RSS feeds",
version: "1.2.7",
version: "1.2.8",
props: {
...rssCommon.props,
urls: {
Expand Down Expand Up @@ -43,7 +43,7 @@ export default defineSource({
console.log(`Retrieved items from ${url}`);
items.push(...feedItems);
}
this.rss.sortItems(items).forEach((item: any) => {
this.rss.sortItems(items).forEach((item: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
const meta = this.generateMeta(item);
this.$emit(item, meta);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineSource({
key: "rss-new-item-in-feed",
name: "New Item in Feed",
description: "Emit new items from an RSS feed",
version: "1.2.7",
version: "1.2.8",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rss from "../../app/rss.app";
import { defineSource } from "@pipedream/types";
import rss from "../../app/rss.app";
import rssCommon from "../common/common";

export default defineSource({
Expand All @@ -8,7 +8,7 @@ export default defineSource({
name: "Random item from multiple RSS feeds",
type: "source",
description: "Emit a random item from multiple RSS feeds",
version: "0.2.7",
version: "0.2.8",
props: {
...rssCommon.props,
urls: {
Expand Down
Loading