npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

habitrpg-todo-sync

v0.3.3

Published

Two-way sync between task managers (e.g. Remember the Milk) and HabitRPG

Downloads

28

Readme

Version 1 is done! Development from here out will be driven by my experience using the tool and maybe yours? File issues!

Original idea: Read the plan at: https://trello.com/card/remember-the-milk/50e5d3684fe3a7266b0036d6/21.

HabitRPG Todo Synchronization

This is a quick-and-dirty tool (currently planned to be a command line-only tool) to get Remember the Milk tasks into HabitRPG and track updates to both each time it's run. It isn't intended to be feature-complete, useful for everyone, or robust. But it is intended to work.

So what does it actually do?

  1. Grabs all your HabitRPG tasks for comparison purposes.
  2. Grabs all your Remember the Milk tasks (taking into account last time it synchronized and if you have passed FULL_SYNC or not).
  3. Now everything happens asynchronously:
  4. Adds new, incomplete tasks from Remember the Milk. The first time you sync, it only grabs the past week, and it only grabs incomplete tasks. Use FULL_SYNC=1 in the environment variables to do a full synchronization.
  5. Deletes any tasks that have been deleted on the Remember the Milk side, but it doesn't do the same for tasks only deleted on the HabitRPG side.
  6. Completes tasks on the Remember the Milk side if they have been completed since last synchronization on the HabitRPG side.

So it's not a true two-way synchronization yet, but it does the job and lets your tasks live in HabitRPG. I recommend deleting them from Remember the Milk and doing a synchronization if you want to delete one. If you want to track one in RTM only, then just delete it from HabitRPG. It might get synchronized again when you change it or complete recurring tasks, etc. in Remember the Milk.

Installation

Clone the repo and run npm install, chmod +x main.js, then ./main.js. That works at least.

Usage

./main.js

If all else fails, node main.js. Put environment variables in front. In development, you might do something like:

BETA_MODE=1 DEBUG_MODE=1 ./main.js` (that's what I usually do)

The first time you run, the app will help you get authenticated with both services. You need accounts on both, of course.

For development, [auth-dev] is used if in .habitrpgrc, but [auth-beta] is not supported because the beta server uses the same DB as the live one.

Environment variables

These generally override anything else the app would try to find out.

  • HRPG_USER_ID: Set the x-api-user instead of getting it from .habitrpgrcgood for development
  • HRPG_API_TOKEN: Set the x-api-key instead of getting it from .habitrpgrcgood for development
  • DEBUG_MODE: Set to 1 to show more verbose output. Also currently works with the node-habit and rtmnode modules bundled in node_modules, though I might take it out when I release them separately. - good for development
  • DEV_MODE: Set to 1 to use http://localhost:3000 instead of https://habitrpg.com
  • BETA_MODE: Set to 1 to use https://beta.habitrpg.com instead of https://habitrpg.com. Note that DEBUG_MODE is stronger than this.
  • DRY_RUN: Set to any truthy value. Don't do any mutative (is that a word?) API operations. Still performs read-only operations. Note that dry run mode still goes through the authentication sequence for Remember the Milk and writes your credentials to a file. It would be fairly useless if it didn't do this. It does not write the marker file for last sync, since this would actually change behavior on the next run.
  • FULL_SYNC: Set to 1 to sync all Remember the Milk tasks instead of just those added within the last week. It goes without saying that this may take a while.
  • FORCE: Run non-interactively. Simply setting this (even FORCE=) is enough. Try to avoid doing this. The prompts are in there for a good reason.
  • FROB: ...internal use only, implementation detail etc. etc.. Basically, if the app gives you an auth URL and you exit out of the app before it authenticates you, but you authorize it on the RTM side, you can copy the frob from the query string and provide it on the command line. This will skip getting a new one from the API.

Roadmap

My next goal is to ignore recurring tasks. And maybe to complete tasks in Habit when they have been completed on the remote end.

I hope this kind of functionality makes it into HabitRPG itself. This is intended as a stopgap, but if people like it, maybe I'll work on it more. Maybe. Civilized requests will get infinitely more attention than entitled flaming.

Complaining about the license is fine. Since it's free, I figured it ought to stay that way even if worked on by others. Give me some compelling reasons, and I'll consider relicensing.

Legal

Remember the Milk wants me to tell you that: "This product uses the Remember The Milk API but is not endorsed or certified by Remember The Milk." So take heed.