Bitcoin Forum
June 21, 2018, 12:12:58 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Automatic URL shortener for bitcointalk posts  (Read 100 times)
EcuaMobi
Legendary
*
Offline Offline

Activity: 1456
Merit: 1172


https://Ecua.Mobi


View Profile WWW
February 22, 2018, 11:49:34 PM
Merited by CodyAlfaridzi (3), Vod (2), owlcatz (1)
 #1

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.

PGP: KeyBase.io/EcuaMobi [Verify / Encrypt] • 37D06E1D43EC62B874DD56868DAFD805AE6D5F7A
Bitcoin full node: node.ecua.mobiUserscripts for bitcointalk: Improved imagesShort URLs
Domains for sale: Current auctionFull list
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
1529583178
Hero Member
*
Offline Offline

Posts: 1529583178

View Profile Personal Message (Offline)

Ignore
1529583178
Reply with quote  #2

1529583178
Report to moderator
EcuaMobi
Legendary
*
Offline Offline

Activity: 1456
Merit: 1172


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:


PGP: KeyBase.io/EcuaMobi [Verify / Encrypt] • 37D06E1D43EC62B874DD56868DAFD805AE6D5F7A
Bitcoin full node: node.ecua.mobiUserscripts for bitcointalk: Improved imagesShort URLs
Domains for sale: Current auctionFull list
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!