Browse Source

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.
master
The Dod 9 years ago
parent
commit
66c998c18c
  1. 1
      .gitignore
  2. 3
      feed2twister.conf.example
  3. 2
      feed2twister.py

1
.gitignore vendored

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

3
feed2twister.conf.example

@ -27,6 +27,9 @@ max_new_items_per_feed = 3 @@ -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

2
feed2twister.py

@ -58,6 +58,8 @@ elif shortener in ['v', 'vgd', 'v.gd']: @@ -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:

Loading…
Cancel
Save