Skip to content

alanwill/urlshortener-tool

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

urlshortener-tool

This app will shorten a long URL using the Goo.gl service. It requires an OAuth token in order to associate its requests with your Google account so that you can log into goo.gl and view the URL analytics.

prerequisites & installation

  1. A Google account
  2. Install the Google Python library
    pip install --upgrade google-api-python-client
    
  3. Rename client_secrets_sample.json to client_secrets.json
  4. Go to the Google Developer Console and enable the URL Shortener API
  5. Create OAuth2 client credentials for the app. For Application Type choose Other.
  6. Now that you have a client ID and secret, populate the client_secrets.json from step 1 with those values. The other 3 keys can be left as is.

That should be it, go ahead and run shorten-url.py and happy URL shortening.

*During the first run you'll be prompted authorize the app, just follow the instructions as it should be pretty self explanatory.

About

Google URL shortener CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages