New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitly4r

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitly4r

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Bitly4R

A Ruby API for the http://bit.ly URL-shortening service

== SimpleClient

This example uses a simpler construction and invocation technique. For when you just need the URLs, and not any additional data.

require 'rubygems' require 'bitly4r'

access_token = ENV['TOKEN'] long_url = 'http://rubyforge.org/'

client = Bitly4R.Token(access_token)

shorten

short_url = client.shorten(long_url) puts "short_url = #{short_url}"

re-expand

raise 'what the?' unless (long_url == client.expand(short_url))

== Client

This example uses a full-fledged construction and invocation technique. The URLs are returned by the to_s methods of the Response objects, and additional data is made available.

require 'rubygems' require 'bitly4r'

access_token = ENV['TOKEN'] long_url = 'http://rubyforge.org/'

client = Bitly4R::Client.new(:token => access_token)

shorten

short_url = client.shorten(long_url).to_s puts "short_url = #{short_url}"

re-expand

raise 'aww, cmon!' unless (long_url == client.expand(short_url).to_s)

== Support

This Client uses version 4.0.0 of the API (eg. '/v4/*'). It supports Access Token credentials.

This gem supports the following API commands:

  • POST /v4/shorten
  • POST /v4/expand
  • GET /v4/bitlinks/:bitlink

For more information, see the API documentation:

== Contributing

=== Issue Tracking and Feature Requests

== Community

=== Wiki

FAQs

Package last updated on 01 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc