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

trello-task-scrubber

v1.0.3

Published

Scrubs Trello cards from one list and moves the results to another list.

Downloads

4

Readme

Trello Task Scrubber

Trello Task Scrubber is a script that essentially moves Trello cards from one list to another list within the same board. In the process it performs the following tasks:

  • Add any labels found in the card name
  • Adds a due date if there is one in the card name
  • Adds me as a card member.

Getting Started

To execute the script, you must first get an API key and an authorization token. Follow the steps below to setup and execute the script:

  1. Visit this page to get an API key and save it somewhere safe
  2. Use this link https://trello.com/1/connect?key=<PUBLIC_KEY>&name=Trello%20Task%20Scrubber&response_type=token&scope=read,write&expiration=never as a template for your authorization page
  • Replace <PUBLIC_KEY> with the key obtained in step 1
  • You can change the expiration if you don't want a permanent token
  • You must leave the scope, this script requires read/write access
  1. Visit the authorization page using the URL built from step 2, after approving the return value should be the authorization token, save this token somewhere safe.
  2. Get the board id, source list id, and destination list id, see instructions below, and save these somwhere save
  3. Install the script using npm install trello-task-scrubber -g
  4. Set the following environment varibles:
  • TrelloKey - Your API Key
  • TrelloToken - Your authorization token
  • TrelloScrubberSourceList - The id of the list cards will be retrieved from
  • TrelloScrubberDestinationList - The id of the list cards will be moved to
  • TrelloScrubberBoardId - The id of the board that houses both lists
  1. Execute the script using trello-task-scrubber
  2. To view help execute trello-task-scrubber -h

Getting list and board ids

  1. In a webpage, go to the Trello board and list whose ids you want
  2. Open a card from that list
  3. In the address bar, add .json to the end of the URL and hit enter
  4. Search for the idList property to get the list id
  5. Search for the idBoard property to get the board id

Why

This script is the first in a small suite of tools I plan to create to automate parts of my daily task management. I use a Trello board to manage random tasks that I need to get done; things like "Clean bedroom" or "Call mechanic". The board has categorical labels such as "Home" for things that need to be done around the house and "Finance" for money related tasks. For tasks that are time sensitive, I also add a due date to the card. I prefer to add labels and due dates when creating the card.

One of the requirements for my task management system is a minimal number of steps to create the card, add labels, add due dates and add myself as a member. With the Trello for Android app, I have to open the app, then open the board, then navigate to the "Incoming" list then create the card. After that I have to then open the card to add myself as a member, add any labels, and add a due date. There is also a "Create Card" Android widget that Trello provides, but I still need to go into the app to add myself as a member, add any labels, and add a due date. Personally, this is too many steps for adding a single card.

My Solution

My solution to this problem is two-fold. The first part (creating the cards) is a manual process. This simply cannot be automated. The second part (scrubbing) is automated by this script.

Creating cards

To get the minimum number of steps for creating a card, I am using the DO Note application by IFTTT. I have a recipe that takes the contents of the note and creates a new Trello card with the contents being the card name. The recipe creates a new card in my "Daily Tasks" board in the list "Incoming from DO Note". The note contents contain the card name, any labels delimited by the "#" symbol and a due date delimited by the "@" symbol. For example, if I wanted to create a card named "Deposit paycheck" with the label "Finance" due on "June 25, 2016 at 4:00 PM", the DO Note contents would look like the following: "Deposit paycheck #Finance @2016-06-25;4:00PM"

Scrubbing cards

For lack of a better word, I use the term "scrubbing" to describe the process of taking the cards created by DO Note and applying labels, due dates, members moving to a new list. The process of how this is done is described below, I just want to note in this section, that to make this truly automatic, I have a cron job on a raspberry pi that executes this script every night.

What

When you execute this script, it looks for cards in a specific Trello list. If any cards are found they run through a specific process before moving to a new Trello list. The process looks like the following:

  1. Parse the name for labels and a due date. Labels are denoted by # and due dates are denoted by @
  2. If there are any labels, add them to the Trello card via the API.
  3. If there is a due date, set the due date on the Trello card via the API.
  4. Strip the labels and due date from the name and update the Trello card's name
  5. Move the card from the source list to the destination list.