rsslytics
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -12,2 +12,2 @@ export interface LogEntry { | ||
} | ||
export declare function countRss(userAgent: string, feedUrl: string, ip: string): LogEntry; | ||
export declare function countRss(userAgent: string, feedUrl: string, ip: string): LogEntry | undefined; |
@@ -24,3 +24,2 @@ "use strict"; | ||
"newsblur", | ||
"miniflux", | ||
"bazqux", | ||
@@ -37,2 +36,6 @@ "tiny tiny rss", | ||
"spacecowboys android rss reader", | ||
"akregator", | ||
"simplepie", | ||
"readyou", | ||
"liferea", | ||
]; | ||
@@ -43,3 +46,9 @@ var replacements = { | ||
}; | ||
var excludes = ["bytespider", "petalbot", "amazonbot", "ariadne", "bingbot"]; | ||
var excludesUrl = ["wp-includes/wlwmanifest.xml"]; | ||
function countRss(userAgent, feedUrl, ip) { | ||
if (excludes.find(function (r) { return userAgent.toLowerCase().includes(r); }) != undefined || | ||
excludesUrl.find(function (r) { return feedUrl.toLowerCase().includes(r); }) != undefined) { | ||
return; | ||
} | ||
var subscriberCountT = userAgent.match(/([0-9]+) subscriber/); | ||
@@ -46,0 +55,0 @@ var subscriberCount = subscriberCountT |
11
index.ts
@@ -50,2 +50,3 @@ const cyrb53 = (str: string, seed = 0) => { | ||
"readyou", | ||
"liferea", | ||
]; | ||
@@ -58,3 +59,13 @@ | ||
let excludes = ["bytespider", "petalbot", "amazonbot", "ariadne", "bingbot"]; | ||
let excludesUrl = ["wp-includes/wlwmanifest.xml"]; | ||
export function countRss(userAgent: string, feedUrl: string, ip: string) { | ||
if ( | ||
excludes.find((r) => userAgent.toLowerCase().includes(r)) != undefined || | ||
excludesUrl.find((r) => feedUrl.toLowerCase().includes(r)) != undefined | ||
) { | ||
return; | ||
} | ||
let subscriberCountT = userAgent.match(/([0-9]+) subscriber/); | ||
@@ -61,0 +72,0 @@ let subscriberCount = subscriberCountT |
{ | ||
"name": "rsslytics", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "Analytics for RSS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
6816
202