Giter Club home page Giter Club logo

bitly-url-shortener-and-click-counter-dvmn's Introduction

Bitly URL Shortener and Click Counter

This is a simple Python script that allows you to shorten URLs using Bitly and check the click count for existing Bitly links. The script uses the Bitly API to interact with the service.

Installation

To use this script, you need to have Python installed on your system. You can download the latest version of Python from the official website.

To install the required dependencies, run the following command:

pip install -r requirements.txt

Installation

To use this script, you need to have Python installed on your system. You can download the latest version of Python from the official website.

To install the required dependencies, run the following command:

pip install -r requirements.txt

Setup

  1. Create an account on Bitly and generate an access token from the API section in your account settings.
  2. Create a .env file in the same directory as the script, and add the following line:

BITLY_ACCESS_TOKEN=<your_access_token

Replace <your_access_token> with the access token you generated from Bitly.

Usage

To use the script, open a terminal or command prompt and navigate to the directory where the script is located.

To shorten a URL, run the following command:

python main.py --link <your_link_to_shorten>

Replace <your_link_to_shorten> with the URL you want to shorten.


To check the click count for an existing Bitly link, run the same command with the Bitly link:

python main.py --link <your_bitly_link>

Replace <your_bitly_link> with the Bitly link you want to check the click count for.

Dependencies

This script requires the following Python packages:

  • python-dotenv==1.0.0
  • requests==2.28.2

Project Goals

This code was written for educational purposes as part of an online course for web developers at dvmn.org.

bitly-url-shortener-and-click-counter-dvmn's People

Contributors

taralas209 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.