Giter VIP home page Giter VIP logo

dndbeyond-api-extension's Introduction

dndbeyond-api-extension

A prototype for a Chrome extension to allow your web app access to your D&D Beyond content.

Caveats

TL;DR This is an egregious hack.

The very idea this is based upon (programmaticallyextracting data from rendered web pages) is very fragile. It's also something that most web pages don't want you to do, so you're likely to start getting captchas to prevent it:

D&D Beyond error page

Using this for an actual user-facing product (or anything that you need to not break) is highly discouraged. Because of this, the code's quality is admittedly not great either.

Usage

Methods in this library return Promises containing the requested data.

Example usage:

dndBeyond.searchMonsters('goblin').then(
  searchResults => displaySearchResults(searchResults));

dndBeyond.getMonsterFromUrl('https://www.dndbeyond.com/monsters/goblin').then(
  monsterData => displayMonster(monsterData));

Setup

  1. Update crx/manifest.json, the manifest of the Chrome extension.

    Make sure you replace all instances of YOUR_APP, YOUR_DOMAIN, etc. with the proper values, and also alter any title/name text you wish.

  2. Load the crx folder as an "unpacked extension" in Chrome.

    Make sure your take note of the extension's ID when it's been loaded. You'll need it for the next step.

  3. Update dndbeyond.js, the proxy script you use in your web app.

    Put your extension's ID in the CHROME_EXTENSION_ID constant near the top of the file.

  4. Include the updated dndbeyond.js script in your page and start using it!

dndbeyond-api-extension's People

Contributors

stabai 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.