New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

public-google-sheets-parser

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

public-google-sheets-parser

Public Google sheets parser for browser

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7K
decreased by-31.91%
Maintainers
1
Weekly downloads
 
Created
Source

Public Google sheets parser for browser


It is a simple parser for browser that helps you use public Google sheets document as if they were a database.

The document to be used must be a Google Sheets document in the 'public' state and have a header in the first row. (e.g. Google sheets for example)

It does not work in browsers where the fetch API is not available.

Currently, it is only available in the browser through the distribution file.

Usage example


<!-- http://fureweb.com/public-google-sheets-parser.html  -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Public google sheets parser for browser</title>
</head>
<body>
  <div class="for-input">
    <input id="sheet-id" type="text" style="width: 300px" placeholder="insert your spreadsheet ID here">
    <button class="get-items">GET ITEMS</button>
  </div>

  <div>
    <p>Sample ID: 10WDbAPAY7Xl5DT36VuMheTPTTpqx9x0C5sDCnh4BGps</p>
    <p><a target="_blank" href="https://docs.google.com/spreadsheets/d/10WDbAPAY7Xl5DT36VuMheTPTTpqx9x0C5sDCnh4BGps/edit#gid=1839148703">SpreadSheet URL</a></p>
  </div>

  <div class="result" style="padding: 16px; border: 1px solid #dedede; background-color: #eee"></div>
  <script src="http://fureweb.com/public-google-sheets-parser.min.js"></script>

  <script>
    (() => {
      const showResult = (string) => {
        document.querySelector('.result').innerHTML = JSON.stringify(string)
      }

      const getItems = () => {
        const spreadsheetIdElement = document.querySelector('#sheet-id')
        if (!spreadsheetIdElement.value) {
          window.alert('Please insert your public spreadsheet ID')
          return spreadsheetIdElement.focus()
        }

        const parser = new PublicGoogleSheetsParser(spreadsheetIdElement.value.trim())
        parser.parse().then((items) => {
          // items should be [{ a :1, b :2, c :3 },{ a :4, b :5, c :6 },{ a :7, b :8, c :9 }]
          showResult(items)
        })
      }
      document.querySelector('.get-items').onclick = getItems
    })()
  </script>
</body>

That's it!

Keywords

FAQs

Package last updated on 16 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc