Skip to content

fiificoder/tinyUrl_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shorten URL

tiny url API

A command-line tool to shorten url and still function effectively. The main aim behind this is to get rid of extremely long URLs [Lovely right?]

This is a very simple Golang project for efficiency, Couldn't guess further more.

Concept

This simple project seems to make use of the os package. Personally,it was my first time using the net/http locally.

Code Reference

baseUrl := "http:https://tinyurl.com/api-create.php?url="
	urlToShorten := os.Args[1]
	getReqUrl := baseUrl + urlToShorten
response, err := http.Get(getReqUrl)
	if err != nil {
		log.Fatal(err)
	}

Run

In the terminal, there must not be less than two arguments, i.e should include program name and url to be shortened.

My URL to be shortened is: https://github.com/fiificoder/CLI-calculator/blob/master/README.md

./urlToShort www.https://github.com/fiificoder/CLI-calculator/blob/master/README.md
go run main.go https://github.com/fiificoder/CLI-calculator/blob/master/README.md

About

Url shortner ; Base URL from tinyurl

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages