• Stars
    star
    293
  • Rank 141,748 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cheerio for Google Apps Script

cheerio for Google Apps Script

This project is unofficial update of https://github.com/3846masa/cheerio-gasify.

Difference to the project is follows.

Script ID: 1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0

Adding the library to your project

Cheerio (cheeriogs) for Google Apps Script is made available as a script library. This is how you add it to your project:

Select "Resources" > "Libraries..." in the Google Apps Script editor. Enter the project key (1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0) in the "Find a Library" field, and choose "Select". (If you have copied the library, enter instead the project key of your copy.) Select the highest version number, and choose Cheerio as the identifier. (Do not turn on Development Mode unless you know what you are doing. The development version may not work.) Press Save. You can now use the Cheerio (cheeriogs) library in your code.

Usage

function getContent_(url) {
    return UrlFetchApp.fetch(url).getContentText()
}

Returns the content of Wikipedia's Main Page

  const content = getContent_('https://en.wikipedia.org');
  const $ = Cheerio.load(content);
  Logger.log($('#mp-right').text());

Returns the content of the first paragraph <p> of Wikipedia's Main Page

  const content = getContent_('https://en.wikipedia.org');
  const $ = Cheerio.load(content);
  Logger.log($('p').first().text());

Changes the content of the gas server part before hosting. !Do not do this. But you can.

  const html = HtmlService.createHtmlOutputFromFile("index").getContent();
  const $ = Cheerio.load(html);
  $("#main").append("<p>Cheeriosse!!1</p>");
  return HtmlService.createHtmlOutput(
    Utilities.formatString("<html>%s</html>", $('html').html())
  );

FAQ

Why can not I debug my code?

The latest Google App Script uses V8 runtime. Version 12 of Cheeriogs supports the runtime. Please upgrade your script. Then, you can do it.

Sponsorship

This project is maintained by volunteers. If you are using this project where it is important, consider one time or regular donations, please.

More Repositories

1

vim-jetpack

The lightning-fast plugin manager, alternative to vim-plug
Vim Script
323
star
2

dmacro.vim

Vim/ Neovim version of dmacro.el, which makes a key macro on-the-fly.
Lua
71
star
3

ddc-fuzzy

Fuzzy matcher, sorter, and conveter for ddc.vim
TypeScript
66
star
4

jsonup

compile-time json-parser
TypeScript
59
star
5

yomu

英和辞書付きPDF閲覧ソフト
JavaScript
48
star
6

vim-glance

Preview document wrtting in YOUR markdown and asciidoc, POD.
TypeScript
38
star
7

ts-match

A **true** pattern matching library for JavaScript/ TypeScript
TypeScript
31
star
8

papyrus

A Literate Programming Tool
Common Lisp
26
star
9

lib.deno.dev

TypeScript
26
star
10

cl-skkserv

Common LispによるSKK辞書サーバーとその拡張
Lex
22
star
11

vim-artemis

Compatibility layer for Vim/ Neovim configuration in Lua
Lua
21
star
12

markdown-it-mathjax3

Add Math to your Markdown with a MathJax plugin for Markdown-it
TypeScript
21
star
13

podium

The documentation tools from POD to Markdown/ HTML/ vimdoc/ LaTeX
Lua
19
star
14

hey.vim

hey.vim is a Vim plugin that utilizes the OpenAI API to edit text.
TypeScript
18
star
15

pkgbrew

non-root package manager based on pkgsrc
Shell
17
star
16

vim-typo

Vim-typo is an autocorrection plugin for Vim/Neovim that relies on a syntax file to provide intelligent corrections while typing.
Vim Script
16
star
17

hyper-tunnel

HTTPS tunnel over WSS
JavaScript
16
star
18

gas-minimal-boilerplate

A minimal boilerplate with webpack for Google Apps Script
JavaScript
15
star
19

ddc-path

Path completion for ddc.vim. This source collects path names with GNU find or sharkdp/fd.
TypeScript
15
star
20

cl-emoji

cl-emoji provides the Unicode emoji characters.
Common Lisp
14
star
21

UFO

Roswell Script Manager
Common Lisp
13
star
22

cl-pov

CommonLisp binding of the Persistence of Vision Raytracer, or POV-Ray.
Common Lisp
13
star
23

regex

regular expression engine for CommonLisp
Common Lisp
12
star
24

ddc-git

Git managed files completion for ddc.vim
TypeScript
10
star
25

unasync

Synchronously execute asynchronous functions on browsers, Node.js, and Deno
JavaScript
9
star
26

plog

A simple markdown based blog engine
PHP
6
star
27

prose-language-server

A Language server for LanguageTool and write-good
JavaScript
6
star
28

textlint-rule-spelling

A textlint rule for spellings of languages as much as possible
JavaScript
6
star
29

typography

Project logo generator
HTML
6
star
30

geo-mirror

This service redirects to the nearest mirror of given distribution
JavaScript
6
star
31

asciidoctor-wasm

TypeScript
6
star
32

textlint-rule-lsp

textlint rule for langauge server protocol
TypeScript
5
star
33

artistic-code-pro

Artistic Code Pro = Mgen+ + FiraCode + NerdFonts
Python
5
star
34

s2.js

LISP to JavaScript. Self-hosting.
JavaScript
5
star
35

wikibox

Modern and Simple CMS inspired by MDWiki
HTML
4
star
36

get-element-by

JavaScript like selector for cl-html-parse
Common Lisp
4
star
37

ddc-onp

DDC filters for An O(NP) Sequence Comparison Algorithm by Sun Wu, Udi Manber and Gene Myers.
TypeScript
4
star
38

trylisp

TypeScript
4
star
39

vim-pdfpreview

TypeScript
3
star
40

ob-acl2

Emacs Lisp
3
star
41

skkservd

skkserv in Deno
TypeScript
3
star
42

pickup.nvim

tani's fuzzy finder
Lua
3
star
43

bfjit

The esoteric programming language interpreter powered by TCC
Zig
3
star
44

acl2-kernel

Jupyter Kernel for ACL2
Jupyter Notebook
3
star
45

skk-jisyo-latex

SKK JISYO for LaTeX symbols
TypeScript
3
star
46

ddc-oldfiles

v:oldfiles completion for ddc.vim You can jump any files in history.
TypeScript
3
star
47

ctrlp-matchfzy

Fast CtrlP matcher using Lua matchfzy() as a replacement of mattn/ctrlp-matchuzzy.
Lua
3
star
48

shake

A simple task runner/ dependency resolver for JavaScript.
TypeScript
3
star
49

nix-common-lisp

Nix template for Common Lisp projects
Nix
2
star
50

scholar-plus

JavaScript
2
star
51

CSIL

LISP implemented in C++
C++
2
star
52

vip

VIP is a vim plugin manager
TypeScript
2
star
53

BISL

LISP on BEAM
Elixir
2
star
54

genei-fonts-mirror

The unofficial mirror of GenEi font families
2
star
55

rehype-template

JavaScript
2
star
56

rehype-inline-css

TypeScript
2
star
57

PDF.gs

extract text from PDF in Google Apps Script
JavaScript
2
star
58

tidy-tabs

JavaScript
2
star
59

unplugin-jsxify

import HTML/POD/Markdown/Asciidoc as JSX components
TypeScript
1
star
60

solv

IPC/CPC theorem prover in Prolog
Prolog
1
star
61

homebrew-linux

Experimental packages for homebrew/linuxbrew
Ruby
1
star
62

clj-imshow

A implementation of OpenCV's imshow
Clojure
1
star
63

hyper-everforest

JavaScript
1
star
64

docs

Vue
1
star
65

hyper-rigel

JavaScript
1
star
66

deno-template

ejs in sandbox
TypeScript
1
star
67

asciidoctor-shiki

JavaScript
1
star
68

markdown-it-pfm

JavaScript
1
star
69

tau

A trivial typed LISP
Racket
1
star
70

wasser

LISP ❤️ WebAssembly
1
star
71

wikir

to search and view wikipedia
HTML
1
star
72

qpdfgrep

Python
1
star
73

ruby-cont

Ruby
1
star