n8n-nodes-twitter-media-upload 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +154 -0
  2. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # n8n-nodes-twitter-media-upload
2
+
3
+ This is an n8n community node that allows you to upload media files (images, videos, audio) to Twitter/X.
4
+
5
+ # Upon Entering Credentials you will get Verification Failed, Avoid it.
6
+ ````
7
+ This is issue from Twitter API,
8
+ ````
9
+ ## Installation
10
+
11
+ ### Community Node Installation (Recommended)
12
+ 1. Go to **Settings > Community Nodes** in your n8n instance
13
+ 2. Click **Install**
14
+ 3. Enter `n8n-nodes-twitter-media-upload`
15
+ 4. Click **Install**
16
+
17
+
18
+
19
+
20
+ ### Manual Installation
21
+ ```bash
22
+ npm install n8n-nodes-twitter-media-upload
23
+ ```
24
+
25
+ ## Project Structure
26
+
27
+ ```
28
+ n8n-nodes-twitter-media-upload/
29
+ ├── credentials/
30
+ │ └── TwitterMediaUploadApi.credentials.ts
31
+ ├── nodes/
32
+ │ └── TwitterMediaUpload/
33
+ │ └── TwitterMediaUpload.node.ts
34
+ ├── package.json
35
+ ├── tsconfig.json
36
+ └── README.md
37
+ ```
38
+
39
+ ## Setup Instructions
40
+
41
+ ### 1. Get Twitter API Credentials
42
+
43
+ 1. Go to [Twitter Developer Portal](https://developer.twitter.com/en/portal/dashboard)
44
+ 2. Create a new project and app
45
+ 3. Navigate to your app's **Keys and Tokens** tab
46
+ 4. Generate and save:
47
+ - API Key (Consumer Key)
48
+ - API Key Secret (Consumer Secret)
49
+ - Access Token
50
+ - Access Token Secret
51
+
52
+ ### 2. Configure Credentials in n8n
53
+
54
+ 1. In n8n, go to **Credentials**
55
+ 2. Click **Add Credential**
56
+ 3. Search for **Twitter Media Upload API**
57
+ 4. Fill in the four required fields:
58
+ - Consumer Key
59
+ - Consumer Secret
60
+ - Access Token
61
+ - Access Token Secret
62
+ 5. Click **Save**
63
+
64
+ ## Usage
65
+
66
+ ### Basic Workflow Example
67
+
68
+ 1. Add a node that provides binary data (e.g., HTTP Request, Read Binary File)
69
+ 2. Add the **Twitter Media Upload** node
70
+ 3. Select your Twitter credentials
71
+ 4. Configure:
72
+ - **Binary Property**: Name of the binary data property (default: `data`)
73
+ - **Media Type**: Select the appropriate media type (image/png, video/mp4, etc.)
74
+ 5. Execute the workflow
75
+
76
+ ### Output
77
+
78
+ The node returns:
79
+ ```json
80
+ {
81
+ "media_id": "1234567890123456789",
82
+ "media_id_string": "1234567890123456789",
83
+ "size": 123456,
84
+ "expires_after_secs": 86400,
85
+ "media_type": "image/png"
86
+ }
87
+ ```
88
+
89
+ You can use the `media_id_string` in subsequent Twitter API calls to attach media to tweets.
90
+
91
+ ## Development
92
+
93
+ ### Building the Node
94
+
95
+ ```bash
96
+ # Install dependencies
97
+ npm install
98
+
99
+ # Build
100
+ npm run build
101
+
102
+ # Watch mode (for development)
103
+ npm run dev
104
+ ```
105
+
106
+ ### Local Testing
107
+
108
+ 1. Link the package locally:
109
+ ```bash
110
+ npm link
111
+ ```
112
+
113
+ 2. In your n8n installation:
114
+ ```bash
115
+ cd ~/.n8n/custom
116
+ npm link n8n-nodes-twitter-media-upload
117
+ ```
118
+
119
+ 3. Restart n8n
120
+
121
+ ## Supported Media Types
122
+
123
+ - Images: PNG, JPEG, GIF, WebP
124
+ - Videos: MP4, MOV
125
+ - Custom: Enter any MIME type manually
126
+
127
+ ## Twitter Media Upload Limits
128
+
129
+ - Images: Max 5MB (JPEG, PNG), 15MB (GIF)
130
+ - Videos: Max 512MB, 140 seconds
131
+ - Media IDs expire after 24 hours
132
+
133
+ ## Troubleshooting
134
+
135
+ ### "Media type not supported"
136
+ - Check that your media type matches the actual file format
137
+ - Try using the "Custom" option with the exact MIME type
138
+
139
+ ### "File too large"
140
+ - Ensure your file is within Twitter's size limits
141
+ - Consider compressing large files before upload
142
+
143
+ ## License
144
+
145
+ MIT
146
+
147
+ ## Support
148
+
149
+ For issues and feature requests, please visit:
150
+ [GitHub Issues]](https://github.com/deepakdhaka-1/n8n-nodes-twitter-media-upload/issues)
151
+
152
+ ## Contributing
153
+
154
+ Contributions are welcome! Please feel free to submit a Pull Request.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-twitter-media-upload",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "n8n node for uploading media to Twitter/X",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -41,16 +41,17 @@
41
41
  ]
42
42
  },
43
43
  "devDependencies": {
44
+ "@types/crypto-js": "^4.2.2",
44
45
  "@typescript-eslint/parser": "^5.30.0",
45
46
  "eslint": "^8.0.0",
46
47
  "eslint-plugin-n8n-nodes-base": "^1.11.0",
47
48
  "gulp": "^4.0.2",
48
49
  "n8n-workflow": "*",
49
50
  "prettier": "^2.7.1",
50
- "typescript": "^4.8.0"
51
+ "typescript": "^5.9.3"
51
52
  },
52
53
  "dependencies": {
53
- "oauth-1.0a": "^2.2.6",
54
- "crypto-js": "^4.1.1"
54
+ "crypto-js": "^4.2.0",
55
+ "oauth-1.0a": "^2.2.6"
55
56
  }
56
57
  }