bitly 1.1.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +36 -3
- data/.rspec +3 -0
- data/.travis.yml +6 -2
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +5 -2
- data/History.txt +32 -1
- data/LICENSE.md +1 -1
- data/README.md +151 -58
- data/Rakefile +6 -9
- data/bitly.gemspec +36 -32
- data/config/env.yml.example +5 -0
- data/lib/bitly.rb +9 -7
- data/lib/bitly/api.rb +19 -0
- data/lib/bitly/api/base.rb +23 -0
- data/lib/bitly/api/bitlink.rb +342 -0
- data/lib/bitly/api/bitlink/clicks_summary.rb +35 -0
- data/lib/bitly/api/bitlink/deeplink.rb +29 -0
- data/lib/bitly/api/bitlink/link_click.rb +75 -0
- data/lib/bitly/api/bitlink/paginated_list.rb +52 -0
- data/lib/bitly/api/bsd.rb +24 -0
- data/lib/bitly/api/click_metric.rb +186 -0
- data/lib/bitly/api/client.rb +588 -0
- data/lib/bitly/api/group.rb +232 -0
- data/lib/bitly/api/group/preferences.rb +73 -0
- data/lib/bitly/api/list.rb +22 -0
- data/lib/bitly/api/oauth_app.rb +26 -0
- data/lib/bitly/api/organization.rb +104 -0
- data/lib/bitly/api/shorten_counts.rb +61 -0
- data/lib/bitly/api/user.rb +107 -0
- data/lib/bitly/error.rb +33 -0
- data/lib/bitly/http.rb +10 -0
- data/lib/bitly/http/adapters.rb +9 -0
- data/lib/bitly/http/adapters/net_http.rb +27 -0
- data/lib/bitly/http/client.rb +33 -0
- data/lib/bitly/http/request.rb +118 -0
- data/lib/bitly/http/response.rb +66 -0
- data/lib/bitly/oauth.rb +109 -0
- data/lib/bitly/version.rb +3 -1
- metadata +82 -111
- data/Manifest +0 -37
- data/lib/bitly/client.rb +0 -145
- data/lib/bitly/config.rb +0 -29
- data/lib/bitly/url.rb +0 -103
- data/lib/bitly/utils.rb +0 -57
- data/lib/bitly/v3.rb +0 -14
- data/lib/bitly/v3/bitly.rb +0 -7
- data/lib/bitly/v3/client.rb +0 -207
- data/lib/bitly/v3/country.rb +0 -13
- data/lib/bitly/v3/day.rb +0 -13
- data/lib/bitly/v3/missing_url.rb +0 -15
- data/lib/bitly/v3/oauth.rb +0 -41
- data/lib/bitly/v3/realtime_link.rb +0 -18
- data/lib/bitly/v3/referrer.rb +0 -13
- data/lib/bitly/v3/url.rb +0 -154
- data/lib/bitly/v3/user.rb +0 -135
- data/test/bitly/test_client.rb +0 -266
- data/test/bitly/test_config.rb +0 -28
- data/test/bitly/test_url.rb +0 -167
- data/test/bitly/test_utils.rb +0 -79
- data/test/fixtures/cnn.json +0 -1
- data/test/fixtures/cnn_and_google.json +0 -1
- data/test/fixtures/expand_cnn.json +0 -1
- data/test/fixtures/expand_cnn_and_google.json +0 -1
- data/test/fixtures/google_and_cnn_info.json +0 -1
- data/test/fixtures/google_info.json +0 -1
- data/test/fixtures/google_stats.json +0 -1
- data/test/fixtures/shorten_error.json +0 -1
- data/test/test_helper.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 33a5d90e877bdac9ea6991afe188e198302be52327b36dd4ee7fc99970b23b2d
|
4
|
+
data.tar.gz: 46dd90271942653821d355f3c670237593f492f7d9a3c57562c2057189b332ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ddc083e1ad6b75fb88772688e70c8d9d65c221d6d8744f637ba05cd8b5b00fbf864847ba4b29d61e2f904e1315d0f3086b0f6e3338fc3d6d20ef5e13c769bc1
|
7
|
+
data.tar.gz: 249edc58187a0c701e8fbc337e80aaa89361b3115816394b48e22a194070a7f472a382ebbabc1bcb964cffac9abd4300b4e2b006b8cf7ed14a505f0ac634301e
|
data/.gitignore
CHANGED
@@ -1,3 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
## Documentation cache and generated files:
|
14
|
+
/.yardoc/
|
15
|
+
/_yardoc/
|
16
|
+
/doc/
|
17
|
+
/rdoc/
|
18
|
+
|
19
|
+
## Environment normalization:
|
20
|
+
/.bundle/
|
21
|
+
/vendor/bundle
|
22
|
+
/lib/bundler/man/
|
23
|
+
|
24
|
+
# for a library or gem, you might want to ignore these files since the code is
|
25
|
+
# intended to run in multiple environments; otherwise, check them in:
|
26
|
+
Gemfile.lock
|
27
|
+
.ruby-version
|
28
|
+
|
29
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
30
|
+
.rvmrc
|
31
|
+
|
32
|
+
# Don't check in credentials
|
33
|
+
config/env.yml
|
34
|
+
]
|
35
|
+
|
36
|
+
.rspec_status
|
data/.rspec
ADDED
data/.travis.yml
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at philnash@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -1,7 +1,38 @@
|
|
1
1
|
=== Ongoing
|
2
2
|
|
3
|
-
|
3
|
+
...
|
4
4
|
|
5
|
+
=== 2.0.1 / 2020-06-18
|
6
|
+
|
7
|
+
* Fixes sending parameters in ClicksSummary (thanks @CodingFu)
|
8
|
+
|
9
|
+
=== 2.0.0 / 2020-03-12
|
10
|
+
|
11
|
+
* Complete overhaul of the gem
|
12
|
+
* Supports version 4 of the Bitly API
|
13
|
+
* See the README and documentation for more details
|
14
|
+
|
15
|
+
=== 2.0.0.beta.2 / 2020-03-02
|
16
|
+
|
17
|
+
* Uses autoload to improve memory consumption
|
18
|
+
|
19
|
+
=== 2.0.0.beta.1 / 2020-02-15
|
20
|
+
|
21
|
+
* Complete overhaul of the gem
|
22
|
+
* Supports version 4 of the Bitly API
|
23
|
+
|
24
|
+
=== 1.1.2
|
25
|
+
|
26
|
+
* 2 minor updates
|
27
|
+
|
28
|
+
* Fix for obtaining clicks for branded subdomains
|
29
|
+
* Some fixes for Ruby compiler warnings
|
30
|
+
|
31
|
+
=== 1.1.1
|
32
|
+
|
33
|
+
* 3 minor updates
|
34
|
+
|
35
|
+
* Updates shoulda/activesupport versions in dev dependencies
|
5
36
|
* Removes development dependency on Echoe and tidies up gemspec
|
6
37
|
* Adds license to gemspec
|
7
38
|
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,93 +1,186 @@
|
|
1
|
-
#
|
1
|
+
# Bitly
|
2
|
+
|
3
|
+
A Ruby gem for using the version 4 [Bitly API](https://dev.bitly.com/) to shorten links, expand short links and view metrics across users, links and organizations.
|
4
|
+
|
5
|
+
[](https://rubygems.org/gems/bitly) [](https://travis-ci.org/philnash/bitly) [](https://codeclimate.com/github/philnash/bitly/maintainability) [](https://inch-ci.org/github/philnash/bitly)
|
6
|
+
|
7
|
+
* [Installation](#installation)
|
8
|
+
* [Usage](#usage)
|
9
|
+
* [Authentication](#authentication)
|
10
|
+
* [Creating an API client](#creating-an-api-client)
|
11
|
+
* [Shorten a link](#shorten-a-link)
|
12
|
+
* [Expand a link](#expand-a-link)
|
13
|
+
* [Available API Endpoints](#available-api-endpoints)
|
14
|
+
* [Groups](#groups)
|
15
|
+
* [Organizations](#organizations)
|
16
|
+
* [Users](#users)
|
17
|
+
* [Bitlinks](#bitlinks)
|
18
|
+
* [Custom Bitlinks](#custom-bitlinks)
|
19
|
+
* [Campaigns](#campaigns)
|
20
|
+
* [BSDs (Branded Short Domains)](#bsds-branded-short-domains)
|
21
|
+
* [OAuth Apps](#oauth-apps)
|
22
|
+
* [Development](#development)
|
23
|
+
* [Contributing](#contributing)
|
24
|
+
* [License](#license)
|
25
|
+
* [Code of Conduct](#code-of-conduct)
|
26
|
+
|
27
|
+
## Installation
|
28
|
+
|
29
|
+
Add this line to your application's Gemfile:
|
2
30
|
|
3
|
-
|
31
|
+
```ruby
|
32
|
+
gem 'bitly'
|
33
|
+
```
|
4
34
|
|
5
|
-
|
35
|
+
And then execute:
|
6
36
|
|
7
|
-
|
37
|
+
```bash
|
38
|
+
$ bundle install
|
39
|
+
```
|
8
40
|
|
9
|
-
|
41
|
+
Or install it yourself as:
|
10
42
|
|
11
|
-
|
43
|
+
```bash
|
44
|
+
$ gem install bitly
|
45
|
+
```
|
12
46
|
|
13
|
-
|
47
|
+
## Usage
|
14
48
|
|
15
|
-
|
49
|
+
### Authentication
|
16
50
|
|
17
|
-
|
18
|
-
Bitly.use_api_version_3
|
19
|
-
```
|
51
|
+
All API endpoints require authentication with an OAuth token. You can get your own OAuth token from the [Bitly console](https://app.bitly.com/). 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.
|
20
52
|
|
21
|
-
|
53
|
+
For other methods to generate access tokens for users via OAuth flows, see the [Authentication documentation](docs/authentication.md).
|
22
54
|
|
23
|
-
|
55
|
+
Once you have an access token you can use all the API methods.
|
24
56
|
|
25
|
-
|
57
|
+
### Creating an API client
|
26
58
|
|
27
|
-
|
59
|
+
All API methods are available through the `Bitly::API::Client`. Initialise the client with the access token like so:
|
28
60
|
|
29
|
-
|
61
|
+
```ruby
|
62
|
+
client = Bitly::API::Client.new(token: token)
|
63
|
+
```
|
30
64
|
|
31
|
-
|
65
|
+
You can then use the client to perform actions with the API
|
32
66
|
|
33
|
-
###
|
67
|
+
### Shorten a link
|
34
68
|
|
35
|
-
|
69
|
+
With an authenticated client you can shorten a link like so:
|
36
70
|
|
37
71
|
```ruby
|
38
|
-
|
72
|
+
bitlink = client.shorten(long_url: "http://example.com")
|
73
|
+
bitlink.link
|
74
|
+
# => http://bit.ly/2OUJim0
|
39
75
|
```
|
40
76
|
|
41
|
-
|
77
|
+
### Expand a link
|
78
|
+
|
79
|
+
With an authorised you can expand any Bitlink.
|
42
80
|
|
43
81
|
```ruby
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
bitly.info('http://bit.ly/wQaT')
|
48
|
-
bitly.stats('http://bit.ly/wQaT')
|
82
|
+
bitlink = client.expand(bitlink: "bit.ly/2OUJim0")
|
83
|
+
bitlink.long_url
|
84
|
+
# => http://example.com
|
49
85
|
```
|
50
86
|
|
51
|
-
|
87
|
+
## Available API Endpoints
|
52
88
|
|
53
|
-
|
89
|
+
This gem supports the following active v4 API endpoints for the[Bitly API](https://dev.bitly.com/v4_documentation.html).
|
54
90
|
|
55
|
-
|
56
|
-
u = bitly.shorten('http://www.google.com') #=> Bitly::Url
|
57
|
-
|
58
|
-
u.long_url #=> "http://www.google.com"
|
59
|
-
u.short_url #=> "http://bit.ly/Ywd1"
|
60
|
-
u.bitly_url #=> "http://bit.ly/Ywd1"
|
61
|
-
u.jmp_url #=> "http://j.mp/Ywd1"
|
62
|
-
u.user_hash #=> "Ywd1"
|
63
|
-
u.hash #=> "2V6CFi"
|
64
|
-
u.info #=> a ruby hash of the JSON returned from the API
|
65
|
-
u.stats #=> a ruby hash of the JSON returned from the API
|
66
|
-
|
67
|
-
bitly.shorten('http://www.google.com', 'keyword')
|
68
|
-
```
|
91
|
+
### Groups
|
69
92
|
|
70
|
-
|
93
|
+
[Groups documentation](docs/groups.md)
|
71
94
|
|
72
|
-
|
95
|
+
- [x] [Retrieve groups (`GET /v4/groups`)](https://dev.bitly.com/v4/#operation/getGroups)
|
96
|
+
- [x] [Retrieve group (`GET /v4/groups/{group_guid}`)](https://dev.bitly.com/v4/#operation/getGroup)
|
97
|
+
- [x] [Update group (`PATCH /v4/groups/{group_guid}`)](https://dev.bitly.com/v4/#operation/updateGroup)
|
98
|
+
- [x] [Delete group (`DELETE /v4/groups/{group_guid}`)](https://dev.bitly.com/v4/#operation/deleteGroup)
|
99
|
+
- [x] [Retrieve tags by group (`GET /v4/groups/{group_guid}/tags`)](https://dev.bitly.com/v4/#operation/getGroupTags)
|
100
|
+
- [x] [Retrieve group preferences (`GET /v4/groups/{group_guid}/preferences`)](https://dev.bitly.com/v4/#operation/getGroupPreferences)
|
101
|
+
- [x] [Update group preferences (`PATCH /v4/groups/{group_guid}/preferences`)](https://dev.bitly.com/v4/#operation/updateGroupPreferences)
|
102
|
+
- [x] [Retrieve Bitlinks by group (`GET /v4/groups/{group_guid}/bitlinks`)](https://dev.bitly.com/v4/#operation/getBitlinksByGroup)
|
103
|
+
- [x] [Retrieve sorted Bitlinks by group (`GET /v4/groups/{group_guid}/bitlinks/{sort}`)](https://dev.bitly.com/v4/#operation/getSortedBitlinks)
|
104
|
+
- [x] [Retrieve group shorten counts (`GET /v4/groups/{group_guid}/shorten_counts`)](https://dev.bitly.com/v4/#operation/getGroupShortenCounts)
|
105
|
+
- [x] [Retrieve click metrics for a group by referring networks (`GET /v4/groups/{group_guid}/referring_networks`)](https://dev.bitly.com/v4/#operation/GetGroupMetricsByReferringNetworks)
|
106
|
+
- [x] [Retrieve click metrics for a group by countries (`GET /v4/groups/{group_guid}/countries`)](https://dev.bitly.com/v4/#operation/getGroupMetricsByCountries)
|
73
107
|
|
74
|
-
|
108
|
+
### Organizations
|
75
109
|
|
76
|
-
|
110
|
+
[Organizations documentation](docs/organizations.md)
|
77
111
|
|
78
|
-
|
112
|
+
- [x] [Retrieve organizations (`GET /v4/organizations`)](https://dev.bitly.com/v4/#operation/getOrganizations)
|
113
|
+
- [x] [Retrieve organization (`GET /v4/organizations/{organization_guid}`)](https://dev.bitly.com/v4/#operation/getOrganization)
|
114
|
+
- [x] [Retrieve organization shorten counts (`GET /v4/organizations/{organization_guid}/shorten_counts`)](https://dev.bitly.com/v4/#operation/getOrganizationShortenCounts)
|
79
115
|
|
80
|
-
|
81
|
-
Bitly.use_api_version_3
|
116
|
+
### Users
|
82
117
|
|
83
|
-
|
84
|
-
config.api_version = 3
|
85
|
-
config.access_token = "API_KEY"
|
86
|
-
end
|
87
|
-
```
|
118
|
+
[Users documentation](docs/users.md)
|
88
119
|
|
89
|
-
|
120
|
+
- [x] [Retrieve user (`GET /v4/user`)](https://dev.bitly.com/v4/#operation/getUser)
|
121
|
+
- [x] [Update user (`PATCH /v4/user`)](https://dev.bitly.com/v4/#operation/updateUser)
|
90
122
|
|
91
|
-
|
92
|
-
|
93
|
-
|
123
|
+
### Bitlinks
|
124
|
+
|
125
|
+
[Bitlinks documentation](docs/bitlinks.md)
|
126
|
+
|
127
|
+
- [x] [Shorten a link (`POST /v4/shorten`)](https://dev.bitly.com/v4/#operation/createBitlink)
|
128
|
+
- [x] [Expand a Bitlink (`POST /v4/expand`)](https://dev.bitly.com/v4/#operation/expandBitlink)
|
129
|
+
- [x] [Retrieve a Bitlink (`GET /v4/bitlink/{bitlink}`)](https://dev.bitly.com/v4/#operation/getBitlink)
|
130
|
+
- [x] [Create a Bitlink (`POST /v4/bitlinks`)](https://dev.bitly.com/v4/#operation/createFullBitlink)
|
131
|
+
- [x] [Update a Bitlink (`PATCH /v4/bitlink/{bitlink}`)](https://dev.bitly.com/v4/#operation/updateBitlink)
|
132
|
+
- [x] [Get clicks for a Bitlink (`GET /v4/bitlink/{bitlink}/clicks`)](https://dev.bitly.com/v4/#operation/getClicksForBitlink)
|
133
|
+
- [x] [Get clicks summary for a Bitlink (`GET /v4/bitlink/{bitlink}/clicks/summary`)](https://dev.bitly.com/v4/#operation/getClicksSummaryForBitlink)
|
134
|
+
- [x] [Get metrics for a Bitlink by countries (`GET /v4/bitlinks/{bitlink}/countries`)](https://dev.bitly.com/v4/#operation/getMetricsForBitlinkByCountries)
|
135
|
+
- [x] [Get metrics for a Bitlink by referrers (`GET /v4/bitlinks/{bitlink}/referrers`)](https://dev.bitly.com/v4/#operation/getMetricsForBitlinkByReferrers)
|
136
|
+
- [x] [Get metrics for a Bitlink by referring domains (`GET /v4/bitlinks/{bitlink}/referring_domains`)](https://dev.bitly.com/v4/#operation/getMetricsForBitlinkByReferringDomains)
|
137
|
+
- [x] [Get metrics for a Bitlink by referrers by domain (`GET /v4/bitlinks/{bitlink}/referrers_by_domains`)](https://dev.bitly.com/v4/#operation/getMetricsForBitlinkByReferrersByDomains)
|
138
|
+
- [ ] __[premium]__ [Get a QR code for a Bitlink (`GET /v4/{bitlink}/qr`)](https://dev.bitly.com/v4/#operation/getBitlinkQRCode)
|
139
|
+
|
140
|
+
### Custom Bitlinks
|
141
|
+
|
142
|
+
- [ ] [Add custom Bitlink (`POST /v4/custom_bitlinks`)](https://dev.bitly.com/v4/#operation/addCustomBitlink)
|
143
|
+
- [ ] __[premium]__ [Retrieve custom Bitlink (`GET /v4/custom_bitlinks/{custom_bitlink}`)](https://dev.bitly.com/v4/#operation/getCustomBitlink)
|
144
|
+
- [ ] __[premium]__ [Update custom Bitlink (`PATCH /v4/custom_bitlink/{custom_bitlink}`)](https://dev.bitly.com/v4/#operation/updateCustomBitlink)
|
145
|
+
- [ ] __[premium]__ [Get metrics for a custom Bitlink by destination (`GET /v4/custom_bitlinks/{custom_bitlink}/clicks_by_destination`)](https://dev.bitly.com/v4/#operation/getCustomBitlinkMetricsByDestination)
|
146
|
+
|
147
|
+
### Campaigns
|
148
|
+
|
149
|
+
- [ ] __[premium]__ [Retrieve campaigns (`GET /v4/campaigns`)](https://dev.bitly.com/v4/#operation/getCampaigns)
|
150
|
+
- [ ] __[premium]__ [Create campaign (`POST /v4/campaigns`)](https://dev.bitly.com/v4/#operation/createCampaign)
|
151
|
+
- [ ] __[premium]__ [Retrieve campaign (`GET /v4/campaigns/{campaign_guid}`)](https://dev.bitly.com/v4/#operation/getCampaign)
|
152
|
+
- [ ] __[premium]__ [Update campaign (`PATCH /v4/campaigns/{campaign_guid}`)](https://dev.bitly.com/v4/#operation/updateCampaign)
|
153
|
+
- [ ] __[premium]__ [Retrieve channels (`GET /v4/channels`)](https://dev.bitly.com/v4/#operation/getChannels)
|
154
|
+
- [ ] __[premium]__ [Create channel (`POST /v4/channels`)](https://dev.bitly.com/v4/#operation/createChannel)
|
155
|
+
- [ ] __[premium]__ [Retrieve channel (`GET /v4/channels/{channel_guid}`)](https://dev.bitly.com/v4/#operation/getChannel)
|
156
|
+
- [ ] __[premium]__ [Update channel (`PATCH /v4/channels/{channel_guid}`)](https://dev.bitly.com/v4/#operation/updateChannel)
|
157
|
+
|
158
|
+
### BSDs (Branded Short Domains)
|
159
|
+
|
160
|
+
[Branded Short Domains documentation](docs/branded_short_domains.md)
|
161
|
+
|
162
|
+
- [x] [Retrieve BSDs (`GET /v4/bsds`)](https://dev.bitly.com/v4/#operation/getBSDs)
|
163
|
+
|
164
|
+
### OAuth Apps
|
165
|
+
|
166
|
+
[OAuth Apps documentation](docs/oauth_apps.md)
|
167
|
+
|
168
|
+
- [x] [Retrieve OAuth App (`GET /v4/apps/{client_id}`)](https://dev.bitly.com/v4/#operation/getOAuthApp)
|
169
|
+
|
170
|
+
## Development
|
171
|
+
|
172
|
+
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.
|
173
|
+
|
174
|
+
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](https://rubygems.org).
|
175
|
+
|
176
|
+
## Contributing
|
177
|
+
|
178
|
+
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](http://contributor-covenant.org) code of conduct.
|
179
|
+
|
180
|
+
## License
|
181
|
+
|
182
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
183
|
+
|
184
|
+
## Code of Conduct
|
185
|
+
|
186
|
+
Everyone interacting in the Bitly project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/philnash/bitly/blob/master/CODE_OF_CONDUCT.md).
|