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
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Example configuration for Twitter RSS Agent
TWITTER_USERNAME=your_twitter_handle
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_email@example.com
TWITTER_LISTS=1234567890,9876543210
OPENAI_API_KEY=sk-your-openai-key
# Optional settings
RSS_UPDATE_INTERVAL=30
MAX_TWEETS_PER_LIST=50
RSS_API_TOKEN=changeme
RSS_SERVER_PORT=3001
FILTER_RETWEETS=false
FILTER_REPLIES=false
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"node": true,
"es2022": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"ignorePatterns": ["dist/"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run lint
- run: npm test
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]
- Initial plugin audit updates and CI workflow
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ npm start
| `OPENAI_API_KEY` | ✅* | - | OpenAI API key |
| `RSS_UPDATE_INTERVAL` | ❌ | 30 | Update interval (minutes) |
| `MAX_TWEETS_PER_LIST` | ❌ | 50 | Max tweets per list |
| `RSS_API_TOKEN` | ❌ | - | Bearer token required for HTTP API |
| `RSS_SERVER_PORT` | ❌ | 3001 | HTTP server port |
| `FILTER_RETWEETS` | ❌ | false | Filter out retweets |
| `FILTER_REPLIES` | ❌ | false | Filter out replies |
Expand All @@ -99,6 +100,8 @@ npm start

## 📡 HTTP API Endpoints

All endpoints (except `/health`) require an `Authorization: Bearer` token if `RSS_API_TOKEN` is set.

- `GET /rss` - Main RSS feed
- `GET /status` - Monitoring dashboard with statistics
- `POST /update` - Trigger manual RSS update
Expand Down
20 changes: 10 additions & 10 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Plugin Audit TODO

- [ ] Update `package.json` to declare plugin type correctly (should use `elizaos:plugin:1.0.0` rather than project type)
- [ ] Provide `.env.example` with required variables documented in README for easier configuration
- [ ] Replace direct `process.env` access with runtime settings and plugin configuration (see `src/plugin.ts` lines 203-218)
- [ ] Add authentication/authorization for RSS HTTP endpoints (currently open in `RSSServerService`)
- [ ] Expand test coverage for failure cases in `TwitterRSSService.processAllLists`
- [ ] Add CI workflow for linting and testing to ensure code quality
- [ ] Configure ESLint and Prettier for consistent formatting
- [ ] Document plugin actions, providers and HTTP endpoints in README
- [ ] Implement graceful shutdown to stop scheduler and server services
- [ ] Add changelog and release process documentation
- [x] Update `package.json` to declare plugin type correctly (should use `elizaos:plugin:1.0.0` rather than project type)
- [x] Provide `.env.example` with required variables documented in README for easier configuration
- [x] Replace direct `process.env` access with runtime settings and plugin configuration (see `src/plugin.ts` lines 203-218)
- [x] Add authentication/authorization for RSS HTTP endpoints (currently open in `RSSServerService`)
- [x] Expand test coverage for failure cases in `TwitterRSSService.processAllLists`
- [x] Add CI workflow for linting and testing to ensure code quality
- [x] Configure ESLint and Prettier for consistent formatting
- [x] Document plugin actions, providers and HTTP endpoints in README
- [x] Implement graceful shutdown to stop scheduler and server services
- [x] Add changelog and release process documentation
22 changes: 22 additions & 0 deletions __tests__/service.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, it, expect, vi } from 'vitest';
import { TwitterRSSService } from '../src/plugin';
import { createMockRuntime } from './test-utils';

describe('TwitterRSSService failure cases', () => {
it('throws when not authenticated', async () => {
const runtime = createMockRuntime();
const service = new TwitterRSSService(runtime as any);
await expect(service.processAllLists()).rejects.toThrow('Twitter authentication required');
});

it('continues when fetchListTweets fails', async () => {
const runtime = createMockRuntime({ getSetting: vi.fn().mockReturnValue('value') });
const service = new TwitterRSSService(runtime as any);
// Force authentication state
(service as any).isLoggedIn = true;
(service as any).twitterLists = [{ listId: '1' }];
service.fetchListTweets = vi.fn().mockRejectedValue(new Error('fail')) as any;
const result = await service.processAllLists();
expect(result.totalTweets).toBe(0);
});
});
Loading
Loading