npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hankei6km/gas-gchanges2notion

v0.1.0

Published

TypeScript definitions for gas library @hankei6km/gas-gchanges2notion

Downloads

3

Readme

gas-gchanges2notion

Google Drive 上の変更リストを Notion データベースへ送信する Google Apps Script ライブラリー。

実装中。

Setup

ライブラリーは App Script で利用できる状態になっています。 Apps Script のコードエディターで以下の手順を実行するとプロジェクトへ追加できます。

  1. コードエディターのファイル名一覧が表示される部分の「ライブラリ +」をクリック
  2. 「スクリプト ID」フィールドに 1_fy-5TJZRGLUiksOZsjRx52b6T7T2jLuP0o_zVfjl5JNNRKW69EsKpE0 を入力し検索をクリック
  3. バージョンを選択(通常は最新版)
  4. 「ID」を GchangesToNotion へ変更
  5. 「追加」をクリック

上記以外にも Release ページから gas-gchanges2notion.zip をダウンロードし、/dist ディレクトリーをプロジェクトへコピーできます。

Usage

Notion 側での手順

データベースを作成

変更内容が送信されるデータベースをが必要です。このリポジトリをローカルへ clone 後、以下のようにスクリプトを実行することで作成できます。 なお、実行には jq が必要です。

$ export NOTION_API_KEY="<API KEY>"
$ export PARENT_PAGE_ID="データベースを作成するページのID"
$ export DATABASE_NAME="作成するデータベースの名前"
$ bash scripts/create_database.sh

user_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
database_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Notion インテグレーションを作成

Notion 外部からデータベースを操作するためのインテグレーション(API KEY)が必要です。以下を参考に作成してください。

インテグレーションへの許可

以下を参考に、用意したデータベースをインテグレーションと共有してください。

Google Apps Script で実行

スタンドアロンのスクリプトを作成し、GchangesToNotion.sendDrive.Changes.list の実行結果を渡すコードを記述します。

const props = PropertiesService.getScriptProperties()
const v = props.getProperties()
const apiKey = v.notion_api_key
const optsv = {
  database_id: v.database_id,
  ignoreIds: JSON.parse(v.ignore_ids),
  limit: 20
}

const res = Drive.Changes?.list({ pageToken })
GchangesToNotion.send(apiKey, opts, res)

Drive.Changes.list を実行するたためには Google Drive の変更通知(プッシュ通知)を受け取る必要があります。 「Google Drive の変更通知を Google Apps Script で受け取る」などを参照してください。

TypeScript

TypeScript(clasp) でコードを記述している場合は、@hankei6km/gas-gchanges2notion を import することで型定義を利用できます。

$ npm install --save-dev @hankei6km/gas-gchamnges2notion

Known Issues

  • 一部のファイルで追加しているカバー画像は、Notion 側へエントリー追加後に時間が経過すると表示されなくなります

License

MIT License

Copyright (c) 2022 hankei6km