All Projects → philnash → Bitly

philnash / Bitly

Licence: mit
A Ruby wrapper for the bit.ly API

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Bitly

zoho-crm-php
An API wrapper library for Zoho CRM, written in PHP.
Stars: ✭ 15 (-96.55%)
Mutual labels:  api-client, api-wrapper
sleeper-api-wrapper
A Python wrapper for the Sleeper Fantasy Football API.
Stars: ✭ 41 (-90.57%)
Mutual labels:  api-client, api-wrapper
clickupython
A client for working with the ClickUp API V2
Stars: ✭ 30 (-93.1%)
Mutual labels:  api-client, api-wrapper
pinboard.net
Fully featured API wrapper for pinboard.in
Stars: ✭ 21 (-95.17%)
Mutual labels:  api-client, api-wrapper
pushover
Go wrapper for the Pushover API
Stars: ✭ 112 (-74.25%)
Mutual labels:  api-client, api-wrapper
mailerlite-api-python
Python wrapper for Mailerlite API v2
Stars: ✭ 31 (-92.87%)
Mutual labels:  api-client, api-wrapper
nyxx
Wrapper around Discord API for Dart
Stars: ✭ 217 (-50.11%)
Mutual labels:  api-client, api-wrapper
Discogs
A Ruby wrapper of the Discogs.com API
Stars: ✭ 195 (-55.17%)
Mutual labels:  api-client, api-wrapper
radiobrowser4j
RadioBrowser Java API library
Stars: ✭ 30 (-93.1%)
Mutual labels:  api-client, api-wrapper
primeuploads-py
An unoffcial python API client for primeuploads.com
Stars: ✭ 40 (-90.8%)
Mutual labels:  api-client, api-wrapper
rdfp
This R package connects the DoubleClick for Publishers API from R
Stars: ✭ 16 (-96.32%)
Mutual labels:  api-client, api-wrapper
cl-kraken
A Common Lisp API wrapper for the Kraken cryptocurrency exchange.
Stars: ✭ 12 (-97.24%)
Mutual labels:  api-client, api-wrapper
Notion Api
Unofficial Notion.so API
Stars: ✭ 250 (-42.53%)
Mutual labels:  api-client, api-wrapper
notionapi-agent
Unofficial Node.js API client for Notion.so
Stars: ✭ 89 (-79.54%)
Mutual labels:  api-client, api-wrapper
Binance
A .NET Standard Binance API library.
Stars: ✭ 199 (-54.25%)
Mutual labels:  api-client, api-wrapper
ksoftapi.py
Official API Wrapper for KSoft.Si API
Stars: ✭ 31 (-92.87%)
Mutual labels:  api-client, api-wrapper
Coingecko Api
A Node.js wrapper for the CoinGecko API with no dependencies.
Stars: ✭ 159 (-63.45%)
Mutual labels:  api-client, api-wrapper
Virustotal Api
Virus Total Public/Private/Intel API
Stars: ✭ 189 (-56.55%)
Mutual labels:  api-client, api-wrapper
doccano-client
A simple client wrapper for doccano API.
Stars: ✭ 52 (-88.05%)
Mutual labels:  api-client, api-wrapper
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-88.51%)
Mutual labels:  api-client, api-wrapper

Bitly

A Ruby gem for using the version 4 Bitly API to shorten links, expand short links and view metrics across users, links and organizations.

Gem version Build status Maintainability Inline docs

Installation

Add this line to your application's Gemfile:

gem 'bitly'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install bitly

Usage

Authentication

All API endpoints require authentication with an OAuth token. You can get your own OAuth token from the Bitly console. Click on the account drop down menu, then Profile Settings then Generic Access Token. Fill in your password and you can generate an OAuth access token.

For other methods to generate access tokens for users via OAuth flows, see the Authentication documentation.

Once you have an access token you can use all the API methods.

Creating an API client

All API methods are available through the Bitly::API::Client. Initialise the client with the access token like so:

client = Bitly::API::Client.new(token: token)

You can then use the client to perform actions with the API

Shorten a link

With an authenticated client you can shorten a link like so:

bitlink = client.shorten(long_url: "http://example.com")
bitlink.link
# => http://bit.ly/2OUJim0

Expand a link

With an authorised you can expand any Bitlink.

bitlink = client.expand(bitlink: "bit.ly/2OUJim0")
bitlink.long_url
# => http://example.com

Available API Endpoints

This gem supports the following active v4 API endpoints for theBitly API.

Groups

Groups documentation

Organizations

Organizations documentation

Users

Users documentation

Bitlinks

Bitlinks documentation

Custom Bitlinks

Campaigns

BSDs (Branded Short Domains)

Branded Short Domains documentation

OAuth Apps

OAuth Apps documentation

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/philnash/bitly. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Bitly project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].