Comment Generator API - Ruby Gem

Comment Generator is a simple tool for generating comments for social media. It returns a list of comments based on the input parameters.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_commentgenerator'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_commentgenerator

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_commentgenerator'

# Initialize the client
client = APIVerve::Commentgenerator::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({
  mode: "text",
  tone: "positive",
  count: 1,
  emojis: true
})

# Print the response
puts response

Error Handling

begin
  response = client.execute({ mode: "text", tone: "positive", count: 1, emojis: true })
  puts response["data"]
rescue APIVerve::Commentgenerator::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Commentgenerator::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Commentgenerator::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "count": 5,
    "mode": "text",
    "tone": "positive",
    "comments": [
      "You're so right! is a game-changer Wow! 😍",
      "Inspiring stuff gives me all the feels Wow! ✨",
      "Thanks for sharing this gives me all the feels Perfect! 💯",
      "Exactly my thoughts is on fire Wow beyond! 🌟",
      "Great outlook in everything here, very bright! slays! For sure! 😊"
    ]
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.