• Stars
    star
    293
  • Rank 136,845 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year 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
309
star
2

ddc-fuzzy

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

jsonup

compile-time json-parser
TypeScript
50
star
4

yomu

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

dmacro.nvim

neovim version of dmacro.el, which makes a key macro on-the-fly.
Lua
43
star
6

vim-glance

Preview document wrtting in YOUR markdown and asciidoc, POD.
TypeScript
37
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

markdown-it-mathjax3

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

podium

The documentation tools from POD to Markdown/ HTML/ vimdoc/ LaTeX
Lua
20
star
13

vim-artemis

Compatibility layer for Vim/ Neovim configuration in Lua
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
14
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
9
star
25

unasync

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

geo-mirror

This service redirects to the nearest mirror of given distribution
JavaScript
8
star
27

plog

A simple markdown based blog engine
PHP
6
star
28

prose-language-server

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

textlint-rule-spelling

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

typography

Project logo generator
HTML
6
star
31

textlint-rule-lsp

textlint rule for langauge server protocol
TypeScript
5
star
32

artistic-code-pro

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

s2.js

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

wikibox

Modern and Simple CMS inspired by MDWiki
HTML
4
star
35

get-element-by

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

ddc-onp

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

pickup.nvim

tani's fuzzy finder
Lua
3
star
38

vim-pdfpreview

TypeScript
3
star
39

acl2-kernel

Jupyter Kernel for ACL2
Jupyter Notebook
3
star
40

bfjit

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

ddc-oldfiles

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

ctrlp-matchfzy

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

skkservd

skkserv in Deno
TypeScript
3
star
44

CSIL

LISP implemented in C++
C++
2
star
45

genei-fonts-mirror

The unofficial mirror of GenEi font families
2
star
46

skk-jisyo-latex

SKK JISYO for LaTeX symbols
TypeScript
2
star
47

vip

VIP is a vim plugin manager
TypeScript
2
star
48

BISL

LISP on BEAM
Elixir
2
star
49

rehype-template

JavaScript
2
star
50

tidy-tabs

JavaScript
2
star
51

solv

IPC/CPC theorem prover in Prolog
Prolog
1
star
52

scholar-plus

JavaScript
1
star
53

ob-acl2

Emacs Lisp
1
star
54

homebrew-linux

Experimental packages for homebrew/linuxbrew
Ruby
1
star
55

clj-imshow

A implementation of OpenCV's imshow
Clojure
1
star
56

hyper-everforest

JavaScript
1
star
57

docs

Vue
1
star
58

hyper-rigel

JavaScript
1
star
59

deno-template

ejs in sandbox
TypeScript
1
star
60

asciidoctor-shiki

JavaScript
1
star
61

markdown-it-pfm

JavaScript
1
star
62

tau

A trivial typed LISP
Racket
1
star
63

wasser

LISP ❤️ WebAssembly
1
star
64

rehype-inline-css

TypeScript
1
star
65

wikir

to search and view wikipedia
HTML
1
star
66

PDF.gs

extract text from PDF in Google Apps Script
JavaScript
1
star
67

qpdfgrep

Python
1
star