Giter VIP home page Giter VIP logo

stb / bibbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefanw/bibbot

0.0 0.0 0.0 2.29 MB

BibBot is a browser extension that removes the paywall on German online news sites using your library account's access to press databases.

Home Page: https://stefanw.github.io/bibbot/

License: GNU General Public License v3.0

Shell 0.43% JavaScript 5.73% TypeScript 76.96% CSS 6.62% HTML 10.26%

bibbot's Introduction

BibBot

Official website

Development

This uses rollup to build the extension files. Install and run like this:

npm install

# Run this during development
npm start

Extension overview

The extension has four different entry points:

  • The content script in src/content.ts runs on the news article page, communicates with background script
  • the background script in src/background.ts which opens new tabs, navigates them around and scrapes the content
  • the options page in src/options.ts is the options page for the extension
  • the popup in popup/ is opened when the extension icon in the toolbar is clicked

These are the relevant players:

  • src/providers.ts contains libraries that you authenticate against and that grant access
  • src/sources.ts contains databases that you can get access to through providers
  • src/sites.ts contains news sites, how to extract their meta data and which source could provide access

For details on how to construct any of these entities, have a look at src/types.ts

Additionally user data like credentials and chosen provider is stored via browser.storage.sync.

Tests

There is a test setup for sites using Jest and Puppeteer that can be run with:

# install dependencies
npm ci
# Run linting and type checking
npm run lint
npm run check-types
# Always run build before tests, as test uses build files!
npm run build
# Run tests
npm run test
# Run tests with actual browser window for one domain
HEADLESS=false npm run test -- -t "test www.zeit.de"

Add testing data to site objects like this:

// ...
  'www.example.com': {
    examples: [
      {
        url: 'http://example.com/article.html',
        selectors: {
          query: 'The string resulting from query selector'
        }
      }
    ],
    // optional setup async function
    testSetup: async (page) => {
        // page is pupeteer page
        // use this for initial page setup
    },
// ...

Release

  1. Run npm version <major|minor|patch>
  2. git push --tags origin main
  3. GitHub release Action will build, test, create release, sign Firefox extension, submit to Chrome Web Store and update website.

bibbot's People

Contributors

stefanw avatar crazyphil avatar errotu avatar pascalkoe avatar ubahnverleih avatar dependabot[bot] avatar hubx avatar drdaxxy avatar tibor avatar danielrheinbay avatar hedderich avatar eknoes avatar thomaskrause avatar asiebelt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.