Bitcoin Forum
May 28, 2024, 09:02:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Automatic URL shortener for bitcointalk posts  (Read 289 times)
EcuaMobi (OP)
Legendary
*
Offline Offline

Activity: 1862
Merit: 1469


https://Ecua.Mobi


View Profile WWW
February 22, 2018, 11:49:34 PM
Last edit: May 28, 2019, 02:31:49 PM by EcuaMobi
Merited by CodyAlfaridzi (3), Vod (2), owlcatz (1)
 #1

Update:
I've closed this and let the domain btct.ws expire because of lack of demand and use.




bitcointalk URL shortener
+ Tampermonkey/Greasemonkey script

Several times I've needed to shorten bitcointalk URLs, especially when including more than one link on trust I've left, "Reference link" is not enough and I don't like posting things like "https://bitcointalk.org/index.php?topic=3001846.msg30865584#msg30865584" on other users' profiles.

So I've created a simple service which takes the topic and msg parameters from that URL, base-62 encodes them and writes a short URL like:
btct.ws/cAUS.25vy0 for this post, or
btct.ws/~I67 for my profile

No database is ever used. It's basically just a URL re-writer.
The creation of these short URLs is done offline on your browser using JS. The forwarding is done on the server (for convenience and to increase compatibility) but nothing is stored and no DB is used.

There are 2 ways to create these links:


1: No installation required, recommended to use it once or a few times only
  • Copy the full URL of a post or a topic
  • Go to https://btct.ws/ (make sure JS is enabled on your browser)
  • Paste the full URL
  • The short URL will appear, ready to be copied

Supported formats are:
https://bitcointalk.org/index.php?topic=3001846.0 => btct.ws/cAUS
https://bitcointalk.org/index.php?topic=3001846.msg30865584#msg30865584 => btct.ws/cAUS.25vy0
https://bitcointalk.org/index.php?action=profile;u=169515 => btct.ws/~I67
https://bitcointalk.org/index.php?action=trust;u=169515 => btct.ws/t~I67
https://bitcointalk.org/index.php?action=merit;u=169515 => btct.ws/m~I67


2: A simple installation is required to make everything automatic
  • Install Tampermonkey on Chrome, Greasemonkey on Firefox, or Violentmonkey on Opera (Read more here: https://openuserjs.org/about/Userscript-Beginners-HOWTO)
  • Install this user script: https://openuserjs.org/scripts/EcuaMobi/btct.ws_shortener (for my convenience, it's based on grue's Merit script)
  • Make sure it's enabled and open any thread on bitcointalk.org
  • Click on #msg (for example #1) shown on any post (see image)
  • A popup will appear showing the short URL, along with the original one (so no functionality is lost). Just copy it. Click the same link again to close it
  • A small (Link) will appear next to every poster's name
  • Click it to show short links to the user's profile, trust and merit

Notes:
  • To make the URL shorter, it is shown without any protocol. If you want you can use http or https, both will work.
  • The alphabet used to convert topic and msg to base-62 is 0-9, a-z, A-Z, in that order

Releases:
     0.2
  • Added support to shorten users' profiles, trust and merit
  • Improved design to make it look like part of the forum
  • Fixed an issue that prevented it from working correctly when clicking any link and goign back
    0.1
  • Initial release

Post here if you have any question or suggestion, or if something's not working fine.

EcuaMobi (OP)
Legendary
*
Offline Offline

Activity: 1862
Merit: 1469


https://Ecua.Mobi


View Profile WWW
February 25, 2018, 02:16:15 AM
 #2

I've updated this to 0.2.
I made some improvements and added support for profiles:


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!