Bit.ly URL shortener AND URL decoder

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

I have started using Twitter more and more lately, and I wanted a quick and easy way to shorten URLs so they would fit inside the limited Twitter textbox.
So, I wrote this small utility that takes a URL as input, and converts it to a Bit.ly URL using the Bitly API.
When you run the program you will be asked for a URL for input. When it has shortened the URL, you will be asked to copy the short URL to the clipboard. That's it.
Like I said, I wanted a small and easy program to do this so I didn't have to go to the website to do it manually.

If you have any suggestions, please feel free to post them here. My plan is to create a simple taskicon program with a simple popup menu system to display various options.

You can download the test program here: http://www.geotrail.no/downloads/Bitly_x86.exe

URL Decoder
  • URL Decoder now works with the following URL shorteners:
  • Bit.ly
  • Is.gd
  • dlvr.it
  • Tinyurl.com
  • Cot.ag
  • j.mp
Update! I've written a small program that decodes the Bit.ly URL's, for all the short url skeptics out there ;)
http://www.geotrail.no/downloads/Bitly_Decoder.exe
Last edited by GeoTrail on Fri Mar 05, 2010 12:53 am, edited 2 times in total.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Bit.ly URL shortener

Post by Rook Zimbabwe »

Geotrail.
EXCELLENT WORK!!!
8)

I am NOT trying to put you down or distress your coding skills. I apologize if that is what it seems. Yes TWITTER needs to loosen up on the URL restrictions since they have actually generated this new tool and all the silly things that malware and hostage ware people do with it!

I have known you for as long as I have been on this board and you don't have an illicit coding bone in your body that I can tell! :D

My company, as a security practice, BANS all types of tinyURL links.

They insist the full path to the link is displayed.

It can get amazing and yes, at times such URL look more like strings of alphabet soup than actual pointers.

But redacted URLs are a risk. It might be a problem later.

I know... I know... Rook is being paranoid again!!! Shut up Rook. Go play somewhere else...
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Bit.ly URL shortener

Post by Kuron »

Rook: OT, your avatar really looks like you.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener

Post by GeoTrail »

Thanks Rook.
No, I do understand your skepticism concerning shortened urls. I am pretty skeptical to them myself, so I only open the urls from Twitter people I trust.

I am working on a simple UI for the program now, but it will run as a task icon program. The whole idea is to make it as small and simple as possible.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Re: Bit.ly URL shortener

Post by +18 »

clean job, thanks GeoTrail :D
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

For all you short url skeptical people out there, I've written a small program that decodes the Bit.ly URL's.
See the first post for the download link.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

Uhhh like uuhhhh BUMP and stuff. uuuuhhhh

Sorry, too much Beavis & Butthead lately.

So has anyone tried the URL decoder lately? Any comments or suggestions?
I'm planning on putting both programs together into one simple to-use taskbar-icon program.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by Joakim Christiansen »

GeoTrail wrote:So has anyone tried the URL decoder lately? Any comments or suggestions?
I'm planning on putting both programs together into one simple to-use taskbar-icon program.
Haven't really tried it, but maybe I will next time someone (I don't trust) sends me one of those weird URL's :P Good work though!

How do you decode exactly? By fetching the "Location" from the HTTP header? That should work on any URL that use direct redirects (not html or javascript).

EDIT: Just tested it, I wrote "ddf" just for fun and woah it returned an URL! So it identifies the "structure" of the "ID string" I write and then takes a guess at which URL-shortening-site site it is and then connects to that site to figure out which URL it points too? (since I didn't have to enter the full URL)
I like logic, hence I dislike humans but love computers.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

Bo it doesn't fetch any headers. It uses the Bit.ly API calls using POST and GET ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by Joakim Christiansen »

GeoTrail wrote:Bo it doesn't fetch any headers. It uses the Bit.ly API calls using POST and GET ;)
What about the other ones you said you support:
* Is.gd
* dlvr.it
* Tinyurl.com
* Cot.ag
* j.mp
They all have API's?
I like logic, hence I dislike humans but love computers.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

They all use the same API calls.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

Does anyone still use these programs?
Reason I ask is because I'm planning on writing a new version from scratch with both the encoder and decoder in one program, with a (hopefully) nice interface and the option to automatically monitor the clipboard for bit.ly and other shortened urls and you will get an info window displaying the decoded url and an option to open the url in icognito mode ;) For those skeptics out there :) Rook) ;) hehehe
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Bit.ly URL shortener AND URL decoder

Post by Kuron »

RIP Rook. :cry:
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Re: Bit.ly URL shortener AND URL decoder

Post by GeoTrail »

What??? :shock:
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
idle
Always Here
Always Here
Posts: 5901
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Bit.ly URL shortener AND URL decoder

Post by idle »

Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply