https://github.com/pajbot/tweet-provider
https://github.com/pajbot/tweet-provider
hacktoberfest
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pajbot/tweet-provider
- Owner: pajbot
- License: mit
- Created: 2019-12-11T11:51:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T11:35:05.000Z (about 2 years ago)
- Last Synced: 2024-07-24T13:16:01.461Z (about 2 years ago)
- Topics: hacktoberfest
- Language: Rust
- Size: 884 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tweet-provider

Provides a WebSocket interface for [pajbot1](https://github.com/pajbot/pajbot) to reduce Twitter API usage.
## Websocket
- Pings every 30 seconds
- Drops connection if no client message for 90 seconds
### API
#### From Client
```json
{ "type": "set_subscriptions", "data": [123456, 234567] }
{ "type": "insert_subscriptions", "data": [123456, 234567] }
{ "type": "remove_subscriptions", "data": [123456, 234567] }
{ "type": "exit" }
```
#### From Server
```json5
{ "type": "ack_subscriptions", "data": [123456, 234567] }
{ "type": "protocol_error", "data": "missing field `type` at line 1 column 2" }
{ "type": "tweet", "data": {
"text": "Adjfkdkoo",
"id": 1218503583311769600,
"created_at": 1579348867,
"user": {
"id": 81085011,
"screen_name": "pajtest",
"name": "paj pajsson"
},
"truncated": false, // if tweet was truncated to 140 characters for compatibility
"in_reply_to_user_id": null, // or number
"in_reply_to_screen_name": null, // or string
"in_reply_to_status_id": null, // or number
"urls": [{
"url": "t.co/dank",
"display_url": "https://google.com",
"expanded_url": null, // or string
"range_start": 0,
"range_end": 9,
}]
}}
```