Skip to content

Commit

Permalink
Remove google from the list of services
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuhrmann committed Apr 22, 2020
1 parent edd323a commit 6f2ae83
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 34 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,24 @@ Open Keypirinha and type 'URL Shortener'. There are three catalog items implemen

```
# Here you can specify the main service used to shorten the url
# Accepted values: google, tinyurl, isgood, bitly
# * Default: google
main_service = google
# Accepted values: tinyurl, isgood, bitly
# * Default: tinyurl
main_service = tinyurl
# Enabling history will allow you to see all your shortened urls
# * Default: yes
enable_history=yes
```

## Suported services
- **Google (default, http://goo.lg)** - This plugin already ships with a Google URL Shortener API key. This is my own personal key. All short URLs are public. You are not required, but you can create your own API KEY if for some reason this service stop working.
- **TinyURL (http://tinyurl.com)** - No further configuration necessary.
- **is.gd (http://is.gd)** - No further configuration necessary.
- **Bitly (http://bit.ly)** - An API key is required. Generate an API KEY on [bit.ly's website](https://bitly.com/a/oauth_apps).

## Change Log
### v1.1
* Remove google from the list of services

### v1.0
* Released

Expand Down
16 changes: 0 additions & 16 deletions src/services/google.py

This file was deleted.

13 changes: 3 additions & 10 deletions src/urlshortener.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

[main]
# Here you can specify the main service used to shorten the url
# Accepted values: google, tinyurl, isgood, bitly
# * Default: google
main_service=google
# Accepted values: tinyurl, isgood, bitly
# * Default: tinyurl
main_service=tinyurl

# Enabling history will allow you to see all your shortened urls
# * Default: yes
enable_history=yes

# The URL used by Google's service
# Generate your api key by accessing: https://console.developers.google.com/apis/credentials
# The API_KEY is required.
[google]
API_URL = https://www.googleapis.com/urlshortener/v1/url?key=
API_KEY = AIzaSyD_6wZK9xkE8JtJqzNGPgrLmWVqgqz4SEA

# The URL used by TinyURL's service
[tinyurl]
API_URL = http://tinyurl.com/api-create.php?url=
Expand Down
5 changes: 1 addition & 4 deletions src/urlshortener.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,22 @@
from .history import History
from .services.bitly import Bitly
from .services.goodis import GoodIs
from .services.google import Google
from .services.tinyurl import TinyURL


class URLShortener(kp.Plugin):
# The keypirinha's category that represents a shortened URL
ITEM_URL = kp.ItemCategory.USER_BASE + 1

# The keypirinha's category that represents a entry in the user's history
ITEM_HISTORY = kp.ItemCategory.USER_BASE + 2
services = {
'google': Google,
'tinyurl': TinyURL,
'isgood': GoodIs,
'bitly': Bitly,
}

# Default service used to shorten urls
DEFAULT_MAIN_SERVICE = 'google'
DEFAULT_MAIN_SERVICE = 'tinyurl'

def __init__(self):
super().__init__()
Expand Down

0 comments on commit 6f2ae83

Please sign in to comment.