Git Product home page Git Product logo

google-sheets-url-shortener's Introduction

Status

Google Sheets URL Shortener

A serverless URL shortener

This URL shortener uses the Google Sheets Data Visualisation API to get the relevant URL from Google Sheets.

Disclaimer:

  • The sheet should be publicly viewable.
  • Private sheets require the user to be logged into a valid Google Account with read access to the Google sheet before using the short link.
  • The link format used here is www.sitelink.tld/#hash.

Instructions

Method 1: Using boiler plate code

Download the current project and edit the fields as required.

  1. Change the content in loading and error div's as required.
  2. Change values of document_key and sheet_number.
  3. Change the assets in the assets folder as required.

Method 2: Using CDN

  1. Add this line to the html page:
    <script src="https://cdn.jsdelivr.net/gh/sampathbalivada/google-sheets-url-shortener/main.js"></script>
  2. Add loading and error div's to the page.
  3. At the bottom of the page add this
<script>
    //Replace 'YOUR_DOCUMENT_KEY' with the document key of your Google sheet
    var document_key = "YOUR_DOCUMENT_KEY";
    //DEFAULT: 0
    var sheet_number = 0;
</script>

Getting the document_key and sheet_number values

  1. Get the shareable link of the Google sheet.
    Example: https://docs.google.com/spreadsheets/d/1md58QgRgGI-PdmZMY_GJj-fXoX0L78D9AeK2NqOFiqY/edit?usp=sharing
  2. The link is in this format:
    https://docs.google.com/spreadsheets/d/{DOCUMENT_KEY}/{PARAMETERS}
  3. The sheet_number is 0 if there is only one sheet in the document.

Sheet Format

The sheet must to be in the below mentioned format.

Hash Link
google www.google.com

Sample Implementation

Explore the sample implementation of this project here.

google-sheets-url-shortener's People

Contributors

sampathbalivada 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.