-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first push, already a working package!
- Loading branch information
0 parents
commit e58f9b7
Showing
17 changed files
with
492 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
comment: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CompatHelper | ||
|
||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
|
||
jobs: | ||
CompatHelper: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1.2.0] | ||
julia-arch: [x86] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: TagBot | ||
on: | ||
schedule: | ||
- cron: 0 * * * * | ||
jobs: | ||
TagBot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
/deps/deps.jl | ||
/docs/build | ||
Manifest.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Documentation: http://docs.travis-ci.com/user/languages/julia/ | ||
language: julia | ||
dist: xenial | ||
os: | ||
- linux | ||
- osx | ||
julia: | ||
- 1.0 | ||
- 1.3 | ||
- 1.4 | ||
- nightly | ||
notifications: | ||
email: false | ||
git: | ||
depth: 99999999 | ||
|
||
jobs: | ||
## uncomment following lines to deploy documentation | ||
include: | ||
- stage: "Documentation" | ||
julia: 1.3 | ||
os: linux | ||
script: | ||
- julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))' | ||
- julia --project=docs --color=yes docs/make.jl | ||
after_success: skip | ||
allow_failures: | ||
- julia: nightly | ||
after_success: | ||
- julia --project=test/coverage -e 'using Pkg; Pkg.instantiate()' | ||
- julia --project=test/coverage test/coverage/coverage.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The Bitly.jl package is licensed under the MIT "Expat" License: | ||
|
||
> Copyright (c) 2020: Tyler Beason. | ||
> | ||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in all | ||
> copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
> SOFTWARE. | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name = "Bitly" | ||
uuid = "d31eeb2a-31cb-4547-bb55-7986690be42f" | ||
authors = ["Tyler Beason <[email protected]>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" | ||
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" | ||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" | ||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
|
||
[compat] | ||
HTTP = ">=0.8, <1" | ||
JSON = ">=0.18, <1" | ||
julia = "^1" | ||
|
||
[extras] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Bitly.jl | ||
|
||
<!-- | ||
 | ||
 | ||
 | ||
 | ||
 --> | ||
[](https://travis-ci.com/tbeason/Bitly.jl) | ||
[](http://codecov.io/github/tbeason/Bitly.jl?branch=master) | ||
[](https://tbeason.github.io/Bitly.jl/stable) | ||
[](https://tbeason.github.io/Bitly.jl/dev) | ||
|
||
|
||
|
||
[Bitly.jl](https://github.com/tbeason/Bitly.jl) is a Julia package for accessing the [Bitly API](https://dev.bitly.com). [Bitly](https://bitly.com) is a popular link shortening service. | ||
|
||
|
||
## Preview | ||
|
||
Right now the package implements only basic methods associated with the service: | ||
- obtaining token via `requestBitlyToken` | ||
- link shortening via `shorten` | ||
- link expansion via `expand` | ||
- click statistics via `clicks` | ||
|
||
I am open to pull requests that extend or improve existing features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
Bitly = "d31eeb2a-31cb-4547-bb55-7986690be42f" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
|
||
[compat] | ||
Documenter = "~0.24" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Documenter, Bitly | ||
|
||
makedocs( | ||
modules = [Bitly], | ||
format = Documenter.HTML(; prettyurls = get(ENV, "CI", nothing) == "true"), | ||
authors = "Tyler Beason", | ||
sitename = "Bitly.jl", | ||
pages = Any["Main" => "index.md"] | ||
# strict = true, | ||
# clean = true, | ||
# checkdocs = :exports, | ||
) | ||
|
||
deploydocs( | ||
repo = "github.com/tbeason/Bitly.jl.git", | ||
push_preview = true | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Bitly.jl | ||
|
||
[Bitly.jl](https://github.com/tbeason/Bitly.jl) is a Julia package for accessing the [Bitly API](https://dev.bitly.com). [Bitly](https://bitly.com) is a popular link shortening service. | ||
|
||
|
||
## Example | ||
|
||
```julia | ||
b = BitlyToken() # loads API Key | ||
S = shorten(b,"https://docs.julialang.org/en/v1/") | ||
S.link # is http://bit.ly/2Us5Vl7 | ||
``` | ||
|
||
## API Key | ||
|
||
Accessing the API requires obtaining a Generic Access Token. | ||
|
||
1. You can log on to your Bitly account to generate a Generic Access Token. | ||
2. You can use the `requestBitlyToken(username,password)` function to do the same. | ||
|
||
```@docs | ||
requestBitlyToken | ||
``` | ||
|
||
### Saving the Access Token | ||
|
||
The access token does not automatically persist across sessions. You need to save it (using one of two methods) if you would like it to do so. | ||
|
||
#### ENV variable | ||
|
||
From the Julia REPL, just do | ||
```julia | ||
ENV["BITLY_ACCESS_TOKEN"] = "yourbitlykey" | ||
``` | ||
|
||
#### Key file | ||
|
||
In the file `~/.bitlyrc`, store the key by itself. | ||
|
||
```julia | ||
keyfile = "~/.bitlyrc" | ||
open(keyfile,"w") do file | ||
println(file,"yourbitlykey") | ||
end | ||
``` | ||
|
||
|
||
### Using the Access Token | ||
|
||
Create an instance of `BitlyToken` either by passing the key in as an argument or it will look for it in the appropriate environment variable or file. | ||
|
||
```@docs | ||
BitlyToken | ||
``` | ||
|
||
## Link Shortening | ||
|
||
You have an ugly long link and want a short one? | ||
|
||
```@docs | ||
shorten | ||
``` | ||
|
||
## Link Expansion | ||
|
||
You have a short uninformative link and want the long one? | ||
|
||
```@docs | ||
expand | ||
``` | ||
|
||
## Link Clicks | ||
|
||
Let's be real. Nobody is clicking your links. Here is how to prove it. | ||
|
||
```@docs | ||
clicks | ||
``` | ||
|
Oops, something went wrong.