New packages: - secubox-app-cyberfeed: Core RSS aggregator service - Pure shell script, OpenWrt compatible - Cyberpunk emoji injection based on content keywords - Caching with configurable TTL - JSON and HTML output with neon/glitch effects - RSS-Bridge support for social media (Facebook, Twitter, YouTube) - luci-app-cyberfeed: LuCI dashboard with cyberpunk theme - Dashboard with stats, quick actions, recent items - Feed management with add/delete - RSS-Bridge templates for easy social media setup - Preview with category filtering - Settings page for service configuration Features: - Auto-emojification (security, tech, mystical themes) - Dark neon UI with scanlines and glitch effects - RSS-Bridge integration for Facebook/Twitter/YouTube - Category-based filtering - Auto-refresh via cron (5 min default) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
149 lines
2.7 KiB
JavaScript
149 lines
2.7 KiB
JavaScript
'use strict';
|
|
'require rpc';
|
|
'require baseclass';
|
|
|
|
/**
|
|
* CyberFeed API Module
|
|
* RPCD interface for CyberFeed RSS Aggregator
|
|
*/
|
|
|
|
var callGetStatus = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'get_status',
|
|
expect: { }
|
|
});
|
|
|
|
var callGetFeeds = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'get_feeds',
|
|
expect: { }
|
|
});
|
|
|
|
var callGetItems = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'get_items',
|
|
expect: { }
|
|
});
|
|
|
|
var callAddFeed = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'add_feed',
|
|
params: ['name', 'url', 'type', 'category'],
|
|
expect: { }
|
|
});
|
|
|
|
var callDeleteFeed = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'delete_feed',
|
|
params: ['name'],
|
|
expect: { }
|
|
});
|
|
|
|
var callSyncFeeds = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'sync_feeds',
|
|
expect: { }
|
|
});
|
|
|
|
var callGetConfig = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'get_config',
|
|
expect: { }
|
|
});
|
|
|
|
var callSaveConfig = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'save_config',
|
|
params: ['enabled', 'refresh_interval', 'max_items', 'cache_ttl', 'rssbridge_enabled', 'rssbridge_port'],
|
|
expect: { }
|
|
});
|
|
|
|
var callRssBridgeStatus = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'rssbridge_status',
|
|
expect: { }
|
|
});
|
|
|
|
var callRssBridgeInstall = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'rssbridge_install',
|
|
expect: { }
|
|
});
|
|
|
|
var callRssBridgeControl = rpc.declare({
|
|
object: 'luci.cyberfeed',
|
|
method: 'rssbridge_control',
|
|
params: ['action'],
|
|
expect: { }
|
|
});
|
|
|
|
return baseclass.extend({
|
|
getStatus: function() {
|
|
return callGetStatus();
|
|
},
|
|
|
|
getFeeds: function() {
|
|
return callGetFeeds();
|
|
},
|
|
|
|
getItems: function() {
|
|
return callGetItems();
|
|
},
|
|
|
|
addFeed: function(name, url, type, category) {
|
|
return callAddFeed(name, url, type || 'rss', category || 'custom');
|
|
},
|
|
|
|
deleteFeed: function(name) {
|
|
return callDeleteFeed(name);
|
|
},
|
|
|
|
syncFeeds: function() {
|
|
return callSyncFeeds();
|
|
},
|
|
|
|
getConfig: function() {
|
|
return callGetConfig();
|
|
},
|
|
|
|
saveConfig: function(config) {
|
|
return callSaveConfig(
|
|
config.enabled,
|
|
config.refresh_interval,
|
|
config.max_items,
|
|
config.cache_ttl,
|
|
config.rssbridge_enabled,
|
|
config.rssbridge_port
|
|
);
|
|
},
|
|
|
|
getRssBridgeStatus: function() {
|
|
return callRssBridgeStatus();
|
|
},
|
|
|
|
installRssBridge: function() {
|
|
return callRssBridgeInstall();
|
|
},
|
|
|
|
controlRssBridge: function(action) {
|
|
return callRssBridgeControl(action);
|
|
},
|
|
|
|
getDashboardData: function() {
|
|
var self = this;
|
|
return Promise.all([
|
|
self.getStatus(),
|
|
self.getFeeds(),
|
|
self.getItems(),
|
|
self.getRssBridgeStatus()
|
|
]).then(function(results) {
|
|
return {
|
|
status: results[0] || {},
|
|
feeds: results[1] || [],
|
|
items: results[2] || [],
|
|
rssbridge: results[3] || {}
|
|
};
|
|
});
|
|
}
|
|
});
|