DEV Community

Hiroyuki Kuromiya
Hiroyuki Kuromiya

Posted on

Extract metadata of paper and export it to Notion DB

I recently developed a chrome extension named "Paper to Notion."

Paper to Notion - Chrome Web Store

A Chrome extension that imports paper metadata from Crossref to Notion using a DOI.

favicon chromewebstore.google.com

Once you input the DOI of the paper, it automatically export it to your Notion DB.

https://youtu.be/Pg0eNnxyVTI?si=WsfSqV-gT2FhWHFg

Structure is very simple: it calls Crossref API to retrieve metadata and uses Notion API to conntect the database.

I used the chrome extension development framework, WXT, which made the development much more easier.

With tagpr, it generates the release zip file automatically, once I pushed any changes to the main branch.

My GitHub Actions workflow file is here:

name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  build-and-release:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'

      - name: Install dependencies
        run: npm install

      - name: Build and zip
        run: npm run zip

      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          draft: false
          prerelease: false

      - name: Strip 'v' prefix from version
        id: strip_v
        run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

      - name: Upload Release Asset
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: .output/paper2notion-${{ env.version }}-chrome.zip
          asset_name: paper2notion-${{ env.version }}-chrome.zip
          asset_content_type: application/zip
Enter fullscreen mode Exit fullscreen mode

Feel free to post any issues and pull requests. I published the extension as OSS!

https://github.com/kromiii/paper-to-notion

Top comments (0)