user_shortener -- roll your own

Since is.gd is tor-hostile and ur1.ca is http only,
I ran out of 3rd party ideas. Like my wife says:
"What you don't do yourself, you do later"
write a user_shortener.py file with a shorten(long_url)
that returns a short url. May the source be with you.
This commit is contained in:
The Dod 2015-01-19 22:27:29 +07:00
parent 4691f72792
commit 66c998c18c
3 changed files with 6 additions and 0 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ README.html
*.swp
*~
*.conf
user_shortener.py

View File

@ -27,6 +27,9 @@ max_new_items_per_feed = 3
# * Ur1.ca [Less tor-hostile] -- Dependencies:
# * https://github.com/legoktm/ur1
# * https://github.com/MiCHiLU/python-functools32
# * user_shortener -- roll your own
# * write a user_shortener.py file with a shorten(long_url)
# that returns a short url. May the source be with you.
use_shortener = False
# tell is.gd to publicly show statistics for the shortened url
shortener_stats = True

View File

@ -58,6 +58,8 @@ elif shortener in ['v', 'vgd', 'v.gd']:
elif shortener in ['ur1', 'ur1.ca', 'ur1ca']:
import ur1
shorten = lambda url: ur1.shorten(url)
elif shortener in ['user_shortener', 'user']:
from user_shortener import shorten # User should create user_shortener.py
elif shortener in ['false', 'no', 'n', '0']:
shorten = lambda url: url
else: