Importing Ski Tracks into Fitbit
30 Mar

Importing Ski Tracks into Fitbit

While I was away skiing this year I got into conversation with a few people in our chalet – all of whom use and love Ski Tracks by CoreCorders.

On evening it came up in conversation that we’d all like a way to import our ski runs into Fitbit. After checking the Fitbit forums this seemed like a highly requested feature, so once I got home I set about seeing if it was possible. Read more »

29 Jun


Today I’m releasing version 0.0.4 of Core. This is a maintenance and consolidation release banking all the changes from 0.0.1. Before anyone starts to wonder, versions 0.0.2 & 0.0.3 were never released. Core’s been artificially accelerated to 0.0.4 – not deliberate, but I cant be bothered going back now.

Bug Fixes

  • acc_del
    • Renamed table function names to remove table prefix (#220
    • Included users cache files in deletion (35e5feb7) , Closes: #220
  • api_cooldown
    • Excluded Nomie and Habitica calls from users global cooldown (79d5d5b1) , Closes: #244
  • auth
    • Prevented unauthorised access generating cache files (ad431669)
  • cache
    • Aged cache based on enviroment (c077c33a)
  • ci
  • clacks
  • config
  • cookies
    • Added some debug lines to see whats happening during user logins (934d12dc) , Closes: #205
  • cron
  • cs
  • database
  • db
  • debug
  • delivery
    • Moved minecraft rewards into seperate table (6e3bd2f7)
    • Added new minecraft delivery tabel (c7cf9f74)
    • Modulised reward delivery (043977cf)
  • dep
    • Added additional dependency ignore files (1d0122c7)
    • Completed dependancy updates (c637d5ba)
    • Added new files for fullcalendar update (5952e989)
    • Updated oauth2-fitbit to version 1.0.2 (a2b29a19) , Closes: #226
    • Updated Sentry to version 1.7.0 (0f716525) , Closes: #228
    • Updated medoo to version 1.4.4 (f188b15c) , Closes: #227
    • Updated leaflet markercluster to version 1.0.5 (b15c45d3) , Closes: #221
    • Updated raven.js to version 3.16.0 (d04d4edc) , Closes: #223
    • Updated mapbox to version 3.1.1 (dfc65199) , Closes: #225
    • Updated fullcalendar to version 3.4.0 (32fc7d07) , Closes: #224
    • Updated chart.js to version 2.6.0 (142423f3) , Closes: #222
  • dep_update
    • Updated Medoo database framework (e8a69148) , Closes: #196
  • deps
  • dev
    • Updated upgrade function translator (1e1a0939)
  • docblock
  • fitbit
    • Handled Access token expired errors (bc2c6a16) , Closes: #256
    • Added a day to the current streak count, too count the first day after all (0e2aacdd)
    • Add checklist for each day to beat (ed75acce)
    • Return task ID when already found (f83ea80a)
    • Added friendly dates (0ce62349)
    • Updated last streak progress bar (e33723f9)
    • Fixed streak length (64204bfc)
  • fitbit_api
    • Added support for new error return to all pullBabel calls (9dd2b5a3) , Closes: #230
    • Added new error code for API errors (a827d41e) , Closes: #230
    • Return null after API errors (ab06b119) , Closes: #230
  • fitbit_profile
    • Replace unused definition with ‘POST’ string (d8ae35f1) , Closes: #232
  • gaming
    • Removed bold text from inbox (70253b63)
    • Removed bold text from inbox (33b5d6e5)
    • Cleaned up reward return (5a167da0)
    • Seperated reward JSON and reward array (8cd20b98)
    • Fixed XP awards (6221f625)
    • Fixed reincluding files (6c4659ac)
    • Fixed config path (05f6ef2a)
    • Tweaked rules and reporting (27ca12dc)
    • changed body addition to bold (8da7c9a2)
    • Reduced develop json cache (553f9962)
    • Changed reward seperator (e0d1e4d7)
    • Cleaned up rewared description (c140819f)
    • Return rewards as array (50f4858b)
    • Max level at 100 (a4ebeba0)
    • Commented out test reward (eb3f0d82) , Closes: #206
    • Added in support for processing file based rewards (865f6ce4) , Closes: #206
    • Added support for checking rewards in config file (024c65a4) , Closes: #206
    • Removed rewardKey random seed (55369845) , Closes: #206
    • Updated gaming to support database JSON input (f51d4271) , Closes: #206
    • Updated XP to user gaming class – awarding health points for water within goals (d077bfb0) , Closes: #206
    • Updated XP to user gaming class – awarding health points for food within goals (04a4f4c0) , Closes: #206
    • Updated XP to user gaming class (efa94096) , Closes: #206
    • Updated XP to user gaming class and guess skill from DB (e036fba7) , Closes: #206
    • Used health as variable when calculating effect (793674b9) , Closes: #206
    • Added XP leveling to gaming class (f5bd402a) , Closes: #206
    • Get level and precentage from database (9fb691f8) , Closes: #206
    • Bumped version (51c305c8) , Closes: #206
    • Added user level and precentage to next level columns (12d35702) , Closes: #206
    • Added class + level icon to xp return (acf240a7) , Closes: #206
    • Added class icon to tasker return (c4180f6a) , Closes: #206
    • Included fulling gaming info in return (02b0f5e4) , Closes: #206
    • Removed random value from rewardKey (860a0270) , Closes: #206
    • Updated gaming system to use new balancing table filtered on class and skill (591d5bf2) , Closes: #206
    • Added skill column (19eaa13f) , Closes: #206
    • Added blancing table (003200d0) , Closes: #206
    • Updated target to skill (eb2201ce) , Closes: #206
    • Added table prefix to class variable (099d6065) , Closes: #206
    • Added user class column (eeb79d98) , Closes: #206
    • Updated XP reward to support array input (a172ee50) , Closes: #206
    • Rehash rewardkey before checking DB same as log award does (8e00ebd7) , Closes: #206
    • Updated XP delivery class to Gaming (df57292c) , Closes: #206
    • Bumped version number (b87a4173) , Closes: #206
    • Added aditonal character fields (a1574537) , Closes: #206
  • git time metric
  • goal_streak
  • habitic
    • Added special rules for steps reached & added method to return cat goals (7450ea54)
    • Added debug to badges (d3f45f4e)
    • Cleaned up date (9ff69da9)
    • Check water all day, not just yesterdays (b25dfe92)
  • habitica
    • Fixed AJAX error (7347ccb6)
    • Gettings users fuid from DB when Habitica ID provided (508ee02e) , Closes: #266
    • Only add checklist to new items (ccc4f58a)
    • Award when goal or above met (be29725d)
    • Limited inbox to 14 items (ae28ed4c)
    • Updated task icons (a6689d7c)
    • Added Nomie icons to inbox (d62cff6d)
    • Updated habitica profile display (ce57f1db)
    • Added Added links to habitica and guild page (337411d3)
    • Added options to signup to Habitica or connect an account (2a2e7942)
    • Completed AJAX habitica account setup (8741541c)
    • Fixed regex for new inbox items (37f83ee6)
    • Resized habitica logo (421e25a8)
    • Added habiticia class icons (a6df0974)
    • Return full error array when required (0aa39e53)
    • Allowed users to sign up for or register habitica (0b7a104b)
    • Added _ to regex (deda625b)
    • Removed emojji from inbox (70975858)
    • Reverted water reward to users prefernce (0a00aadd)
    • Updated reward habit names (49fe5651)
    • Added rewards for fitbit badges (a3de8eb6)
    • updated reward to be range based (d5e31f07)
    • Fixed use of _GET variable (380b9b2f)
    • Added additonal output when rewards already completed (79aa2a68)
    • Return gold and silver values with XP (88f6ee06) , Closes: #208
    • Populate gold value (7a25a91f) , Closes: #208
    • Added new gold column to DB (7da768be) , Closes: #208
    • Changed bold value from direction to task value (38a02211)
    • Invited new users to guild (2cca37d1)
    • Added feature to invite users to guild (cdfc5fb9)
    • Added better error reporting (65916517)
    • Check events back 24hours (382b4c19)
    • Added tags (0fcd8439)
    • Removed debug code (0f826959)
    • Avoid cache when creating new tasks (40560ab8)
    • UNDO — Search for the right type too (eed0ed08)
    • Search for the right type too (541e2d35)
    • Override cache (9dc73b56)
    • Moved task clean up (51c74b3f)
    • Added option to override local cache (5a7e7870)
    • Removed debug var_dump (362783e5)
    • Ignore PNG avatars (46abe189)
    • Changed indentation (fb012a9b)
    • Return avatar (505e07a5)
    • Download users avatar (520b9f95)
    • Added method to record reward delivery (51173a8b)
    • Changed format of due date (89f4a6ec)
    • Updated _search function making it public (5b56746f)
    • Query database after updating Nomie events then process that for rewards (2b0719e1)
    • Added alias to create task function (b881b664)
    • Added extra notes to streak todo’s (8c77ef9f)
    • Updated score values (1ca55111)
    • Added crushed and smashed rules (7df78107)
    • Added check to reward any unspecific activity (895d9d8a)
    • Dont cache ID’s for todo’s (6675e586)
    • Removed debug text (153de1ee)
    • Stopped double hashing rewardKey’s (2eb32b06)
    • Added search/create for tags (d97017a1)
    • Added tags class storage and corrected json push (a6444af3)
    • Removed hardcoded gaming rules (7466493d)
    • Updated difficulty (14923cb0)
    • Hardcoded water target (c7f8a3c5)
    • Removed hard coded Gaming rewards (0470d279)
    • Disabled notifyUser (fdb3dc54)
    • Finished support for habitica webhook (f1acf2a6)
    • Fixed variable mistake, should use _GET since doesnt work on cron (141eb9ed)
    • turned json_decode to associated array (e2fbd5ff)
    • Added habitica trigger to install habits and tasks, and update user XP stats (6fdbebbc)
    • removed XP update after completing action (will use webhook instead) (b02f14b1)
    • Added as allowed trigger (58964e70)
    • ignore testing file (3c0cc20a)
    • Record delivery (3a54cf27)
    • Removed down tick, punishment is failed daily (173f5734)
    • Added down ticks (74f30c60)
    • Updated user stats (1edf264c)
    • Added testing access for habitica webhook (a4e65fa5)
  • ignore
  • inbox
    • Added API limits to inbox (7e900d34)
    • Used new inbox system for home page inbox (a78ce22b)
  • journey
  • js
    • Used API private location return in privacy page (9895bac5)
    • Add padlock to private tracks (bfa3a4a7)
    • When geo loaction isnt availble or page isnt secure (Chrome blocks geolocation on insecure pages) centre map on Madras College (f1f3243c)
    • Added map geo points to title bar (a63cae86)
    • Corrected trending texts (bdd60714)
    • Corrected weight trend colours (ec49327f)
    • Fixed longest streak beating value (65ea1395)
    • Removed -‘s from 7-day analysis (a737f8bd)
  • nomie
    • Dont query nomie if user isnt setup for it (d2a647aa) , Closes: #229
    • Fix for some misplaced array elmliments (bb5f5ee7)
  • nomie pull
  • nxr
  • php
    • Crushed some more divison by zero errors (701a3444)
  • phpunit
    • Installed phpDocumentor from binary (406718ea)
    • Updated paths to ssh keys (f3d65ed9)
    • Removed broken unit tests (e6e5a6f9)
  • privacy
    • Use new privacy json format (92f362b9)
  • return
    • Added weight loss forcasting graph (a5c9268d)
    • Added returnUserRecordWeightLossForcast function (01f1900e)
    • Removed debug information and set private if start OR end are in circle (ed3d9844)
    • Check for user cookie before returning private GEO posts (f22f0e87)
    • Added return feature for private locations (7c436701)
  • reward
  • reward_nomie
    • Past more details of the event to the reward system (f1f27000)
  • reward_wordpress
  • reward_xp
  • rewards
    • Added function to return rewards by delivery system (cbea53d1)
    • Complete write of rewards (2d40be22)
    • Made leveling harder (ee6045ee)
    • Ignore current XP images (92ded2eb)
    • Added XP reward list to inbox and reward icon to tasker return (57952781)
    • Allowed key id to be null (478329e5)
    • Updated first level end point (7eaf35b5)
    • Added leveling data returns (145ee190)
    • Only check for hunderth awards on previous day (0228d5f5)
    • Code format (7859f3f9)
    • Awarded XP at point of award (2a0482d4)
    • Tightend up Minecraft awards (f97289ee)
    • Dont create new rewards at all (22ddaeae)
    • Delete old awards (75511b82)
    • Only create new awards in dev environments (5b78fbcd)
    • Added XP awards (12e4d1e1)
    • Added key’s to each reward (84b9f3f2)
    • Added reward key items to table, defaults to current date to prevent duplicate rewards (2aaeb082)
  • sec
  • streak
    • Correced steak rules & code format (193e5a41)
  • tcx
    • Updated TCX download path (ae9ac6da)
    • Removed override visability (f2c06d58)
    • Corrected file path and added support for multiple geo points (80e495eb)
  • todo
  • update
  • upgrade
    • Prevented . upgrade interfering (2e3f36d9)
  • ux
    • Updated index limit (94c0eb59)
    • Updated device layout (6e330816)
    • Mobile layout for fat page (9246b6ec) , Closes: #239
    • Mobile layout for weight page (685efa09) , Closes: #238
    • Mobile layout for dashboard page (a93e8b19) , Closes: #237
    • Mobile layout for food page (2ac78ba3) , Closes: #240
    • Mobile layout for Nomie dashboard page (1502959a) , Closes: #241
    • Mobile layout for Accounts page (74a0d2e0) , Closes: #242
    • Renamed simple-line-icons in CSS to avoid conflict with Nomie (199f8ec5)
  • wp
  • xp


  • nxr
  • acc_del
    • Updated cache folders (605ecfbc) , Closes: #220
    • Force user to goto logout page (2e9c0821) , Closes: #220
    • Added functions to remove user from all database tables, including realted items like device charges and sleep logs (d0bdf9f6) , Closes: #220
    • Get a list of all database tables, and the user column name for each (6f53011c) , Closes: #220
    • Updated UX components to trigger AJAX action (0bb13b9b) , Closes: #220
    • Updated AJAX to identify forms (602db5cf) , Closes: #220
    • Added delete UX elements (37c8dc94) , Closes: #220
    • Added new account pages (8ac33424) , Closes: #220
  • account
    • Allowed users to set which intents they user, update their password, generate a new API key and update the email address. (91f556ad) , Closes: #233
  • auth
    • Added base function to return users authentication (96db59ab) , Closes: #243
    • Added base function to return users authentication (328d8ab9) , Closes: #243
  • ci
  • conv
    • Added converter function from Runtastic to Fitbit (0ebef2cc)
  • dev
    • Added shell helper convert version numbers to function names (41bbdf1c)
  • fitbit
  • habitica
    • Users can now choose to join quests automatically or do it manually (c35190f8) , Closes: #269
    • Added auto purchasing of Gems (8d822cd4) , Closes: #268
    • Added new UX settings for Habitica Fun options (73e35ea0) , Closes: #264
    • Changed log output (a2cfcb66) , Closes: #264
    • Selling off spare potions (e7320f36) , Closes: #264
    • Used built in class for pet type (25dca45d) , Closes: #264
    • Added user settings checks (1f6ce9d3) , Closes: #264
    • Added some fun to habitica users (17d65a00) , Closes: #259
  • nxr
    • Added support for arrays and objects (c44fe832) , Closes: #267
  • privacy_geo
    • Fixed privacy to include radious and delete/create cache items (2f1dd8a4) , Closes: #247
    • Allowed users to add and remove privacy marks (164dc942) , Closes: #110
  • reward
    • Reacted to meal quality and trigger new rewards (b5fb8cd2)
  • settings
    • Completed users journey selection (f523d21f) , Closes: #246
    • Added journey values into data return (4424f0b1) , Closes: #246
  • sidebar
  • ux


  • phpblock
    • Updated block comment (24228328)
    • Updated param (675bcedb)
    • Correctly defined @param variables (bccee77b)
    • Correctly defined @param variables (81b70281)
    • Correctly defined @param variables (67b7e929)
    • Correctly defined @param variables (2347bea2)
    • Correctly defined @param variables (5c585538)
    • Correctly defined @param variables (2a30910c)


  • ci
  • docblock
  • errors
    • Added some more error tags for Fitbit API try failures (70c69222)
  • fitbit
    • Only trigger fitbit activity based on previous days record (a1db3ee3)
  • habitica
    • Updated criteria for healthy meals (170a9f89)
    • Looking for users habitica creditials in DB (3d82e44a)
    • Used ENVIRONMENT definition to decide if which habitica server to connect too (40049027)
    • Used ENVIRONMENT definition to decide if which habitica server to connect too (e6896f84) , Closes: #263
    • Looking for users habitica creditials in DB (cd648a51) , Closes: #262
    • Changed config key’s (088a443c) , Closes: #261
  • ignore
  • phpdoc
    • Generated missing DocBlocks (83735087)
  • phpunit
    • Moved todo (e0bf3789)
    • Updated test stages (8d470147)
    • Updated test stages (86c23216)
    • Updated test rules (58157826)
    • Updated rsync path (8aeaf480)
    • Updated test directory (a47200e2)
    • Added missing phpdoc blocks and TODO statments for all untested methods (4be219a0)
    • Added missing phpdoc blocks and TODO statements for all untested methods (d4d92f93)
    • Moved tests to new folder out of lib (9d1e938f)
  • settings
    • Moved active intents settings into seperate settings page (50dfbfc1)
  • style
  • update
  • ux
    • Updated icons in sidebar (63ce32fe)
    • Added blanker space for future journey support (4bad15f1) , Closes: #246


  • unit test
    • Updated code coverage (9b08589d)
    • Moved config tests to one file (e18c1021)
    • Moved vender to bundle folder, git ignored DEV packages (72daa1de)
    • Changed site ID (15236268)
    • Updated copyright in all files (4caa323d)
    • Added new tests, and method to delete from database (4114965e)
    • Added test for config storage in DB and array (e9164d45)
    • Removed autoload require, updated test function names (4eba5005)
    • Added bootstrap (c3bea2b4)
    • Don’t log to console if running in unit test (5f6e1744)
    • Don’t test private functions (e6f28d6f)
    • Added unit test to ErrorRecording (5c8d4098)
    • Added unit test to Analytics (cc626200)


Branchs merged

  • Merge branch ‘feature/issue_230_232’ into develop (c0f874a0)
  • Merge branch ‘feature/issue_220’ into develop (82bcb2a3)
  • Merge branch ‘feature/UnitTests’ into develop (2cc4f10a)
  • Merge branch ‘feature/DocBlock’ into develop (4c7bfa5d)
  • Merge branch ‘feature/Check_Dependancy_Versions’ into develop (1fba37f8)
  • Merge branch ‘develop’ into ‘master’ (242a08b6)
  • Merge branch ‘develop’ into ‘master’ (0afeca3b)
  • Merge branch ‘develop’ into ‘master’ (9bafd1f9), Closes: #190
  • Merge branch ‘develop’ into ‘master’ (ddf0d740)
  • Merge branch ‘develop’ into ‘master’ (a86681bb), Closes: #189
  • Merge branch ‘develop’ into ‘master’ (53b132e8), Closes: #183

Other Commits

  • Added depednacy checking test (1f9f6f3e)
25 Jun


I’ve been using my Fitbit every day without break since I first got it in June 2012 and while the Fitbit dashboard is good, offering everything you could ever want, I felt the need to roll my own – as always.

Fitbit offer a fantastic API which I aimed to make full use of. When I started my project I couldn’t find anything else on the net like it. My project is slightly further along than this one, I am contacting the developer to offer my code and see if we can both work up a finished product.

NxFitness Core is stable and working on this site, but it is heavily tailored to my setup and the code has only recently been made public. The code is poorly commented and depends on my, but I am working on it. If you are interested in this code please email me

build status coverage report Open Issues Closed Issues Authors MIT License


The best live example of this module can be found on my own site

Ways to contribute

A common misconception about contributing to an open source is that you need to contribute code. In fact, it’s the other parts of this project that are most neglected or overlooked. You’ll do the project a huge favour by offering to pitch in with these types of contributions!

Code contributions that make the project better are always welcome. Please read the Git commit guidelines and Contributor covenant code of conduct and submit a pull request for addition to the main source.

Possibly the simplest way to contribute is simply to download and install the software yourself – use it as stable code or try and break it – and report any bugs you find, ether manually or enable the automatic error reports.

During setup just uncomment the sentry io dsn configuration line and core will report code bugs and unexpected exceptions to sentry it’s self. Despite this being incredibly useful I’ve disabled it by default. See the sentry explanation page for information about what is transmitted.

If you have something that will help please let me know.


And of course:

  • MIT – Copyright (c) 2014-2017 Stuart McCulloch Anderson

Development contributions from:


Git Based License Server
12 Jan

Git Based License Server

I usually forget to include anything in files and after a quick Google I found this script on GitHub by remy to host your license details online. I do not tend to use the MIT license myself so I needed to enhance the code a bit to fit my needs. This is my version of his code. Bellow is the project README file, and under that you can download the project for your self.

Now I can always include in all my projects which links stuart (the cname) against my copyright holder name Stuart McCulloch Anderson – all stored in the users directory.

The user.json file

The users directory contains a list of files, each representing a host on The minimum requirement for the JSON is that is contains a copyright field – everything else is optional. Remember to ensure the user.json file is valid JSON.

Available fields:

yourname | url | company | companyurl |theme | format | email | gravatar | pgpkey | pgpid | pgpurl | boilerplate | oslicense


Add your name. This can be your full name, part of it or just the nickname you prefer


You can also include a link to your email which is displayed after the copyright notice using the email property (note the mailto: is automatically added):


If you want to make a link from the copyright text, you can include a url property:


And if you want to show your gravatar, just add the gravatar boolean property:

Note that the gravatar requires the email property. You also need to check the compatibility of the chosen theme. Currently, only the default theme supports Gravatar.


You can add a link to your PGP/GPG key if you use one here:


If you work in a company or other organisation which shares the copyright with you, you can include if the company field:


You can also use a separate URL for your company than for you:


Themes are CSS files. The default is in the same style as but you can change the CSS or add a new file. Each user has control over the theme displayed here:


And if you want your license to appear as plain text or markdown, just add the format property (currently only txt, md and html are supported):


It is often it is advantageous to add some additional text to the licence blurb. You can do that here:


The default license is the FreeBSD license, but a user has control over changing their default here. The license must exist in the license folder, else it will revert to FreeBSD:

License version targeting

License version targeting allows you to link your license to a specific revision in this project – therefore fixing it permanently to a specific license text.

Though I don’t expect the license text to change ever, this is just some extra assurance for you.

Targeting requires the sha from the license commit. This can be specified on the URL (in your permalink) or in the JSON file.

For example: (make sure to view-source) shows an older version of the LICENSE.html file (compared to the latest version – the older version didn’t have the new themes).

This can also be targeted in my JSON file:

Note that if no version is supplied, the latest copy of the LICENSE.html will be displayed with your information included.


If you’ve got an eye for design you can contribute a theme by adding a CSS file to the themes directory. The default theme is simple and clean, but you can add your own as you like.

To use a theme, add the theme property to your user.json file, for example:

Current available themes:

Formats & URLs

The following types of requests can be made to this project:

You can select the license to use as well. This must be the same as the file name inside the
licenses folder

You can also select a specific commit file version to display, you just need the
sha from the license commit

The url also supports including a start year:

Now that you see the formula you can combine all these elements together to build a very specific license file:

Ways to contribute

If you can help make the software better than please let me know, or just check out the Git repository for your self then just send me a patch file – currently my Git central repository doesn’t offer user registrations, but I will do it manually if you feel you would benefit from it.

Development contributions from:

Development contributions to mit-license (at the time it was forked) from:


And of course:

The MIT License (MIT):