New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rssbot

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rssbot - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

12

dist/bin/main.js

@@ -18,14 +18,16 @@ #!/usr/bin/env node

await register();
break;
(0, util_1.close)();
return;
case "unregister":
await unregister();
break;
(0, util_1.close)();
return;
case "unregisterall":
await unregister(true);
break;
(0, util_1.close)();
return;
case "run":
await run();
break;
return;
}
(0, util_1.close)();
}

@@ -32,0 +34,0 @@ async function register() {

@@ -6,2 +6,2 @@ import { SlashOpts } from "../src";

export declare function ask(q: string): Promise<string>;
export declare function close(): never;
export declare function close(): void;

@@ -7,3 +7,2 @@ "use strict";

const path_1 = require("path");
const process_1 = require("process");
const readline_1 = require("readline");

@@ -55,4 +54,3 @@ const src_1 = require("../src");

readline.close();
(0, process_1.exit)(0);
}
exports.close = close;

@@ -115,2 +115,4 @@ "use strict";

});
// list all avaiable feeds
// client as contructor parameter if no token
}

@@ -117,0 +119,0 @@ rssCommands(cmd) {

import { ColorResolvable, MessageEmbed, TextChannel } from "discord.js";
import History from "./History";
export interface Article {
export interface Post {
title: string;
link?: string;
url?: string;
}

@@ -14,3 +14,3 @@ export default abstract class Feed {

color: ColorResolvable;
protected abstract _fetch(): AsyncGenerator<Article, void, void>;
protected abstract _fetch(): Promise<Post[]>;
fetch(): Promise<void>;

@@ -17,0 +17,0 @@ send(msg: string | MessageEmbed): void;

@@ -16,9 +16,7 @@ "use strict";

try {
for await (const article of this._fetch()) {
const embed = new discord_js_1.MessageEmbed().setTitle(article.title.replaceAll("&#039;", "'"));
if (article.link)
embed.setURL(article.link);
embed.setColor(this.color);
this.send(embed);
}
const items = await this._fetch();
const embed = new discord_js_1.MessageEmbed().setTitle(`[${this.name.toUpperCase()}] ${new URL(this.url).hostname}`);
items.forEach(item => embed.addField(item.title.replaceAll("&#039;", "'"), item.url ?? "\u200B"));
embed.setColor(this.color);
this.send(embed);
}

@@ -25,0 +23,0 @@ catch (err) {

@@ -1,2 +0,2 @@

import Feed, { Article } from "./Feed";
import Feed, { Post } from "./Feed";
import { PrunableHistory } from "./History";

@@ -9,3 +9,3 @@ export default class RSSFeed extends Feed {

constructor(name: string, url: string);
_fetch(): AsyncGenerator<Article, void, void>;
_fetch(): Promise<Required<Post>[]>;
}

@@ -18,16 +18,15 @@ "use strict";

}
async *_fetch() {
async _fetch() {
const res = await axios_1.default.get(this.url);
const site = (0, fast_xml_parser_1.parse)(res.data);
for (const item of site.rss.channel.item) {
if (this.history.has(item.link))
continue;
this.history.set(item.link, new Date().getTime());
yield {
title: `[${this.name.toUpperCase()}] ${item.title}`,
link: item.link,
return site.rss.channel.item
.filter(item => !this.history.has(item.link))
.map(item => {
return {
title: item.title,
url: item.link,
};
}
});
}
}
exports.default = RSSFeed;
{
"name": "rssbot",
"version": "1.0.3",
"version": "1.1.0",
"description": "Turn your Discord server into a RSS feed",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -57,3 +57,3 @@ # EasyDiscordRSS

class SomeRandomSiteFeed extends Feed {
async *_fetch(): AsyncGenerator<Article, void, void> {
async _fetch(): Promise<Article> {
/*

@@ -60,0 +60,0 @@ get site data and scrape

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc