bbolli / tumblr-utils

Utilities for dealing with Tumblr blogs, Tumblr backup
GNU General Public License v3.0
667 stars 124 forks source link

Short URLS: Bad practice. #229

Closed ohhdemgirls closed 2 years ago

ohhdemgirls commented 3 years ago

Using short URLs is bad practice for preservation, should the index go offline short urls are useless. (among other issues) You should revert this change or give the option as a flag to users.

https://github.com/bbolli/tumblr-utils/blob/master/tumblr_backup.py#L955

Read more about this position here, while in this case tumblr isn't a short url service I think the same applies.

bbolli commented 3 years ago

Patches welcome!

doersino commented 3 years ago

Looking back through the commit history, it seems like short URLs are written to the HTML files because they still work if the blog has been renamed in the meantime, see https://github.com/bbolli/tumblr-utils/commit/39cade9db0ba792d155d8d3834f56aed02ed649e – so their usage prevents a kind of link rot that might be more common/likely than Tumblr's link shortener dying.

If you supply the --json flag, both will at least be stored.

superuser7777 commented 2 years ago

Request : Optional implementation of short URL and normal URL :)

bbolli commented 2 years ago

Quoting myself:

Patches welcome!

superuser7777 commented 2 years ago

I managed to implement it with AHK script.

^LButton:: ;Ctrl+LClick *Please use with a shortened URL link*
Critical, On
Clipboard := ""
Send, {RButton}
Sleep, 100
Send, t
Sleep, 100
req := ComObjCreate("WinHttp.WinHttpRequest.5.1")
req.Open("HEAD", Clipboard) ;Start URL expansion
req.Option(6) := False ; Disable auto redirect
req.Send()
url_origin := req.GetResponseHeader("Location")
RegExMatch(url_origin, "\d{5,}", url_edit) ;Article POST number extraction
WinActivate, ahk_class Chrome_WidgetWin_1
Run, C:\chrome.exe "https://www.tumblr.com/edit/your_tumbler_id/%url_edit%/"
Return
cebtenzzre commented 2 years ago

@superuser7777 Yes, as long as Tumblr still works a web request is all you need to resolve a short URL. A button to edit a post is a different matter - you could open a new issue if you think that's a useful feature.