outofthecave / emojit

The browser extension to let you rate any web page.

Home Page:https://chrome.google.com/webstore/detail/fdaopifdchifnfaiammaknlaniecbdmo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emojit

Emojit allows you to rate any web page using emojis 🀯

This repository holds the public code for Emojit.

Browser Extension

You can install our extension in various browsers:

It should work for Firefox but we haven't built it and tried it yet.

Code

See the code for our browser extension.

Website + Embeddable Widget

Core Code including the API client.

API

To install our package, you will need to authenticate with GitHub Packages:
npm login --scope=@emogit --registry=https://npm.pkg.github.com

See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages for details.

Install the package:
npm install @emogit/emojit-core

or

yarn add @emogit/emojit-core

Examples:

import { createNewUserId, EmojitClient, ReactionModification, ReactRequest } from '@emogit/emojit-core'

// Create a client for a specific user.
// A userId is a v4 UUID. It should be kept secret.
const userId = createNewUserId()
const client = new EmojitClient(userId)

// Add a reaction to a page.
const reactResponse = await client.react(new ReactRequest(
    'https://emojit.site/test',
    [
        new ReactionModification('πŸ’•', 1),
        new ReactionModification('πŸ€“', 1),
    ]))
// reactResponse has the user's current reactions for the URL:
// { reactions: ['πŸ’•', 'πŸ€“'] }

// Check the reactions on a page.
const pageReactions = await client.getPageReactions('https://emojit.site/test')
// pageReactions has the reactions for all users for the URL:
// { reactions: [{ reaction: 'πŸ‘¨β€πŸ’»', count: 3 }, { reaction: 'πŸ’•', count: 2 }, { reaction: 'πŸ€“', count: 1 }, ...]}

See client.ts for full details.

Development

Some helpful commands from the root:

  • Install all subprojects: ./scripts/run-all.sh yarn install
  • Lint all: ./scripts/run-all.sh yarn lint
  • Lint --fix all: ./scripts/run-all.sh yarn lint-fix
  • Test all: ./scripts/run-all.sh yarn test

About

The browser extension to let you rate any web page.

https://chrome.google.com/webstore/detail/fdaopifdchifnfaiammaknlaniecbdmo

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:TypeScript 92.9%Language:JavaScript 5.6%Language:HTML 1.4%Language:Shell 0.1%