Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

amirali/kutt.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kutt.rb

Gem Gem

⚠️ This repo will be archived until further notice.
Long story short, I had some ideas about contributing to kutt itself and update this repo as it goes on. But for the past months, I could find the time nor energy to do it. If you are willing to maintain this repo, contact me via email to discuss the ideas and transfer the ownership.

A Ruby wrapper for kutt.it API

$ gem install kutt

To get an apikey you need to signup at kutt.it and generate API key from settings.

Check API response details at Official repo. For connection to https://kutt.it

require 'kutt'
k = Kutt.new 'apikey'

For a custom hosted version of kutt.it.

require 'kutt'
k = Kutt.new 'apikey', 'https://custom-kutt.co'

submit a new short url:

# returns status code and object as hash or error
# `customurl`, `password`, `reuse` are optional
# set `reuse: true` to prevent duplicate shortend url for the same link
k.submit("url", customurl: "customurl", password: "password", reuse: true)

list urls (5 by default, 50 Maximum):

k.list # returns first 5 hash of urls list or error

# list(count = 5, page = 1)
k.list(50) # to list first 50 urls (50 Maximum)
k.list(50, 2) # to list second 50 urls (default value for page number is 1)

list all of urls (slow):

k.list_all # returns all of urls

count number of links you created:

k.count # returns in string fromat

delete an url:

k.delete("id or url") # returns message of success or error

stats of an specific url:

k.stats("id or url") # returns link stats in detail or error

About

kutt library for ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages