post-to-ripple
v1.0.2
Published
A simple module to post content to rippl.fun
Readme
post-to-ripple
A simple npm module to post content to rippl.fun with optional images.
Installation
You can install this module via npm from the npm registry or from a local directory.
Install via npm:
npm install post-to-rippleUsage
This module allows you to post content to rippl.fun by providing your PHP session ID, the content to post, and optionally, an image URL to include in the post.
Example
Basic Usage (without an image):
const postToRipple = require('post-to-ripple');
const postData = {
phpsessid: 'your-php-sess-id-here', // Your PHP session ID
postContent: 'Here is my post content with some cool message!' // Content of your post
};
postToRipple(postData)
.then(() => {
console.log('Post submitted successfully!');
})
.catch((error) => {
console.error('Error submitting post:', error);
});Usage with an Image:
const postToRipple = require('post-to-ripple');
const postData = {
phpsessid: 'your-php-sess-id-here', // Your PHP session ID
postContent: 'Here is a post with an image!', // Content of your post
imageUrl: 'https://example.com/image.jpg' // Optional: URL of the image to attach
};
postToRipple(postData)
.then(() => {
console.log('Post submitted successfully!');
})
.catch((error) => {
console.error('Error submitting post:', error);
});Parameters
The function postToRipple() accepts an object with the following properties:
phpsessid: Required - Your PHP session ID. This is necessary for authentication with the rippl.fun website.postContent: Required - The content you want to post. This can be a simple text string or a more complex message.imageUrl: Optional - If provided, this URL will be used to attach an image to the post. The image is downloaded from the URL and uploaded along with the post.
Error Handling
If an error occurs during the post submission (e.g., invalid session ID, network issue, or image download failure), it will be caught and logged to the console.
License
This project is licensed under the MIT License - see the LICENSE file for details.
