Coder Social home page Coder Social logo

delightedcrow / mmm-habiticastats Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 3.0 11.68 MB

MMM-HabiticaStats is a module for MagicMirror² that displays player statistics for Habitica.

License: MIT License

JavaScript 9.89% HTML 13.55% CSS 76.55%
habitica magicmirror habitica-account

mmm-habiticastats's Introduction

MMM-HabiticaStats: A MagicMirror² Module

MMM-HabiticaStats is a module for MagicMirror² that displays player statistics for Habitica.

REQUIRED API KEYS:

You're gonna need a (free) Habitica account to get an API token (see the Habitica wiki for details on how to find your API Token in your Habitica account).

Screenshots

Example Screenshots of MMM-HabiticaStats running in the default MagicMirror² theme:


Example Screenshots of MMM-HabiticaStats running in the WallberryTheme:

Installing the Module

To use this module:

  1. Copy the MMM-HabiticaStats folder to your MagicMirror/modules directory
  2. Add the module to the modules array in the config/config.js file like in the following example:
modules: [
	{
		module: "MMM-HabiticaStats",
		position: "middle_center", // put it wherever you want
		config: {
			userID: "YOUR-HABITICA-USER-ID-HERE",
			APIToken: "YOUR-HABITICA-API-TOKEN-HERE"
		}
	}
]

Configuration options

The following properties can be configured:

Option Type Description
userID String Your Habitica userID. Sign up for free at https://habitica.com.

This value is REQUIRED
APIToken String Your Habitica API Token.

This value is REQUIRED
refreshRate Number How often the module should refresh your Habitica data (in milliseconds).

Possible values: Any positive integer
Default value: 60 * 60 * 1000, 1 hour
backgroundBlurOn Boolean Turn the background blur on; good for making the text more legible on photo backgrounds.

Possible values: true (turn on) or false (turn off)
Default value: true
zoom Float Scale this module using the CSS zoom property.

Possible values: A float number. Examples: 1.5 (scale up 150%), 0.7 (scale down 70%)
Default value: none
orientation String Whether to display the module in portrait or landscape orientation.

Possible values: portrait, landscape
Default value: portrait
positionCSS String Finely position this module with the power of CSS. BE CAREFUL, you can break all kinds of things with this.

Possible values: Any string of valid CSS. Example: "float: right; position: relative; top: -10px;"
Default value: none

Fixing The Background Blur

Please make sure you have the config option backgroundBlurOn: true set first!

If you're running MagicMirror using Electron (i.e, not in serveronly mode) and the background blur isn't showing up for you, try enabling Electron's experimentalFeatures option by adding the following block to your config options in your MagicMirror config.js file:

electronOptions: {
	webPreferences: {
		experimentalFeatures: true,
		nodeIntegration: false
	}
},

Contributing & Development

Changelog

To view the changelog see CHANGELOG.md.

Building CSS

This module uses SASS, so to make style changes please edit the MMM-HabiticaStats.scss file and use node-sass to compile the css file:

  • Run the command npm install to install node-sass.
  • Run npm run watch and node-sass will autocompile the CSS file any time changes are made to the MMM-HabiticaStats.scss file.
  • Run npm run build to build the CSS file.

mmm-habiticastats's People

Contributors

arrayoffrost avatar delightedcrow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

shqlzx c2v4 dysantic

mmm-habiticastats's Issues

Issues with number of calls to the Habitica API

Hi @delightedCrow , Matteo from Habitica here.

We've had some issues with an user of this module unknowingly making hundreds of thousands of requests to the content API in a very short period of time.

We're still unsure if this was caused by setting a zero refreshRate or if there's some loop in the code but I've noticed a few things:

please let me know if you can fix these issues and if you have any question :)

Ah, I'd also make sure the refresh rate cannot be set lower than 30s to avoid API calls being made too often as explained here https://habitica.fandom.com/wiki/Guidance_for_Comrades

Could not connect to Habitica server

I get the error Could not connect to Habitica server.. when I load it.

    {
      module: "MMM-HabiticaStats",
      position: "bottom_right",
      config: {
        userID: "a22efff0-2af3-4bce-8075-e810ea228871",
        APIToken: "truncated"
      }
    },

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.