Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add twitterapi.io search plugin #1641

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
29d4b70
Add Twitter search plugin
Jan 1, 2025
b946f72
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 1, 2025
3bcb3cf
chore: update pnpm-lock.yaml
Jan 2, 2025
640d0c0
chore: regenerate pnpm-lock.yaml
Jan 2, 2025
dbf6301
chore: resolve pnpm-lock.yaml conflicts
Jan 2, 2025
b32b232
feat: translate commit messages to English
Jan 2, 2025
ba3644c
chore: sync pnpm-lock.yaml with upstream
Jan 5, 2025
bd56b16
chore: sync dependencies with upstream
Jan 5, 2025
154a85a
chore: resolve conflicts with upstream
Jan 5, 2025
a60e466
Merge branch 'develop' into 1431--add-twitter-search-plugin
kaitoInfra Jan 5, 2025
23448ea
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 5, 2025
19dd2d8
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 5, 2025
33dfe36
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 5, 2025
39e20c7
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 5, 2025
b89d46a
feat:add tsup.config.ts file
Jan 5, 2025
bbf33bb
Merge branch '1431--add-twitter-search-plugin' of github2:kaitoInfra/…
Jan 5, 2025
dc2bc53
Merge remote-tracking branch 'upstream/develop' into 1431--add-twitte…
Jan 5, 2025
6a3a41d
Merge branch 'develop' into 1431--add-twitter-search-plugin
odilitime Jan 6, 2025
087abcc
Merge remote-tracking branch 'upstream/develop' into 1431--add-twitte…
Jan 6, 2025
95a3850
merge: resolve conflicts with upstream/dev
Jan 6, 2025
8df612b
Merge branch '1431--add-twitter-search-plugin' of github2:kaitoInfra/…
Jan 6, 2025
2c69bc6
merge: resolve conflicts with upstream/dev
Jan 8, 2025
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ TWITTER_TARGET_USERS= # Comma separated list of Twitter user names to
TWITTER_RETRY_LIMIT= # Maximum retry attempts for Twitter login
TWITTER_SPACES_ENABLE=false # Enable or disable Twitter Spaces logic

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future #A third-party Twitter API key for data retrieval. This shared key is for testing only - get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
14 changes: 14 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ TWITTER_PASSWORD=abc # Your Twitter/X account password
TWITTER_EMAIL= [email protected] # Your Twitter/X account email
TWITTER_COOKIES= '' # Your Twitter/X cookies, copy from broswer
TWITTER_2FA_SECRET= # Two-factor authentication

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations


```

### 2. 编辑角色文件
Expand Down Expand Up @@ -188,6 +196,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
7 changes: 7 additions & 0 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ TWITTER_USERNAME= # Nombre de usuario de la cuenta
TWITTER_PASSWORD= # Contraseña de la cuenta
TWITTER_EMAIL= # Correo electrónico de la cuenta

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations


X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
3 changes: 3 additions & 0 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ TWITTER_USERNAME= # アカウントのユーザー名
TWITTER_PASSWORD= # アカウントのパスワード
TWITTER_EMAIL= # アカウントのメール

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
#Twitter データ取得用のサードパーティ API キーです。これは共有テストキーのため、QPS制限を避けるに#は https://twitterapi.io で個人キーを取得することをお勧めします。

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions README_PTBR.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ TWITTER_USERNAME= # Nome de usuário da conta
TWITTER_PASSWORD= # Senha da conta
TWITTER_EMAIL= # Email da conta

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
5 changes: 5 additions & 0 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ TWITTER_USERNAME= # Имя пользователя аккаунта
TWITTER_PASSWORD= # Пароль аккаунта
TWITTER_EMAIL= # Email аккаунта

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Ключ стороннего API Twitter для получения данных.
# Это общий тестовый ключ - получите персональный ключ на https://twitterapi.io,
# чтобы избежать ограничений QPS

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
- TWITTER_PASSWORD=
- TWITTER_EMAIL=
- X_SERVER_URL=https://api.red-pill.ai/v1
- TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future #A third-party Twitter API key for data retrieval. This shared key is for testing only - get your personal key at https://twitterapi.io to avoid QPS limitations
- BIRDEYE_API_KEY=
- SOL_ADDRESS=So11111111111111111111111111111111111111112
- SLIPPAGE=1
Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
7 changes: 7 additions & 0 deletions docs/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email


TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# 第三方推特API,不需要使用自己的账号获取twitter上的数据。避免自己的账号被封禁和速率限制。
# 当前Key是一个共享,只是作为测试使用,当前支持50QPS,但是使用人数多的话,也可能会有并发问题。
# 在这里获取自己的免费的KEY:https://twitterapi.io 保证稳定性。


X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ TWITTER_PASSWORD= # Kontopasswort
TWITTER_EMAIL= # Konto-E-Mail
TWITTER_COOKIES= # Konto-Cookies

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Zugriff auf Twitter-Daten ohne Login oder Proxy, vermeidet Kontobeschränkungen #und Rate-Limits.
# Ein Drittanbieter-Twitter-API-Schlüssel für Massendatenabruf.
# Dieser gemeinsam genutzte Schlüssel ist nur zum Testen gedacht.
# Holen Sie sich Ihren persönlichen Schlüssel auf https://twitterapi.io, um #QPS-Beschränkungen zu vermeiden

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/README_TH.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ TWITTER_USERNAME= # ชื่อผู้ใช้บัญชี
TWITTER_PASSWORD= # รหัสผ่าน
TWITTER_EMAIL= # อีเมล

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
1 change: 1 addition & 0 deletions docs/docs/advanced/eliza-in-tee.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ services:
- TWITTER_USERNAME=$TWITTER_USERNAME
- TWITTER_PASSWORD=$TWITTER_PASSWORD
- TWITTER_EMAIL=$TWITTER_EMAIL
- TWITTER_API_IO_KEY=$TWITTER_API_IO_KEY
- X_SERVER_URL=$X_SERVER_URL
- BIRDEYE_API_KEY=$BIRDEYE_API_KEY
- SOL_ADDRESS=So11111111111111111111111111111111111111112
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/api/_media/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/api/_media/README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Accédez aux données Twitter sans connexion ni proxy, en évitant les restrictions #de compte et les limites de taux.
# Une clé API Twitter tierce pour la récupération de données à haut volume.
# Cette clé partagée est uniquement destinée aux tests.
# Obtenez votre clé personnelle sur https://twitterapi.io pour éviter les #limitations de QPS

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/api/_media/README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ TWITTER_USERNAME= # アカウントのユーザー名
TWITTER_PASSWORD= # アカウントのパスワード
TWITTER_EMAIL= # アカウントのメール

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
#Twitter データ取得用のサードパーティ API キーです。これは共有テストキーのため、QPS制限を避けるに#は https://twitterapi.io で個人キーを取得することをお勧めします。

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/api/_media/README_KOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ TWITTER_USERNAME= # Bot Twitter username
TWITTER_PASSWORD= # Bot Twitter password
TWITTER_EMAIL= # Twitter account email
TWITTER_DRY_RUN=false # Test mode without posting

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations
```

#### Telegram Configuration
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ Add to your `.env`:
TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email

TWITTER_API_IO_KEY=elizaOS_public_key_love_truth_future
# Access Twitter data without login or proxy, avoiding account restrictions and #rate limits.
# A third-party Twitter API Key for high-volume data retrieval.
# This shared key is for testing only.
# Get your personal key at https://twitterapi.io to avoid QPS limitations
```

**Important:** Log in to the [Twitter Developer Portal](https://developer.twitter.com) and enable the "Automated" label for your account to avoid being flagged as inauthentic.
Expand Down
22 changes: 22 additions & 0 deletions packages/plugin-twitter-search/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
testMatch: ["<rootDir>/src/tests/**/*.test.ts"],
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^@/(.*)$': '<rootDir>/src/$1',
'^@elizaos/core$': '<rootDir>/src/tests/__mocks__/core.ts'
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
useESM: true,
tsconfig: 'tsconfig.json'
}]
},
moduleDirectories: ['node_modules', '<rootDir>/../..'],
setupFilesAfterEnv: ['<rootDir>/src/tests/setup.ts']
};

export default config;
36 changes: 36 additions & 0 deletions packages/plugin-twitter-search/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@elizaos/plugin-twitter-search",
"version": "0.1.0",
"description": "Twitter API integration plugin using twitterapi.io service",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "jest",
"lint": "eslint src/**/*.ts"
},
"keywords": [
"twitter",
"api",
"search",
"social",
"eliza",
"plugin"
],
"dependencies": {
"@elizaos/core": "workspace:*"
},
"peerDependencies": {
"@elizaos/client-twitter": "workspace:*"
},
"devDependencies": {
"@jest/globals": "29.7.0",
"@types/jest": "29.5.11",
"jest": "29.7.0",
"ts-jest": "29.1.1",
"tsup": "^8.0.0",
"typescript": "^5.0.0",
"eslint": "^8.0.0"
}
}
Loading
Loading