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

tumblr-tags

v1.0.3

Published

This tool parse all tags used in the posts of a Tumblr blog. You can use the tag information to make a tag cloud.

Downloads

4

Readme

Tumblr tags

This tool parse all tags used in the posts of a Tumblr blog. You can use the tag information to make a tag cloud.

Prerequisites

Setup

npm install tumblr-tags --save-dev

In the root of your project create a configuration file ttags.js with content:

module.exports = {
  blog: '…',
  consumerKey: '…'
}

| Key | Required | Defaults | Description | | ----------------- | -------- | -------- | ------------------------------------ | | blog | yes | | Your tumblr blog name | | consumerKey | yes | | API consumer key | | cachePath | | tmp | Cache folder path | | outPath | | dist | Dist folder with tags.json | | transform(tags) | | | Transform tags written to outPath. |

Parse tags

There is a node script ./node_modules/.bin/ttags. You can run it directly or add an npm npm script to package.json and run it npm start:

  "scripts": {
    "start": "ttags"
  }

It queries blog posts and save tag data to the cache directory. Cache has the following structure:

{
  tags: {
    <tag>: tag-index,
  },
  posts: {
    <post-id>: tag-index[]
  }
}

Cache is only for internal usage. A tags.json file is created/updated after every cache change. It's an output you are looking for and it has simple structire:

[
  { tag: "my tag", count: 1},
  { tag: "another tag", count: 4},
  …
]

When you call ttags script it will skip all the cached posts and it will look only for the new ones so you can run it periodically to update your tag information.

If you want to parse the whole blog again simply remove source.json file in the cache directory and run ttags

Parse a single post

When a post is in the cache and you update its tags in tumblr it can useful to update the cache only for this post. You can pass a post id as an argument:

ttags post 139236866355 139236480280 […]

Transform method

You can specify a transform method in the config file. It accepts all tags as an argument. This is a place you can filter of modify you tags. Let's remove all the tags that occur only once in the blog:

module.exports = {
  transform: tags => tags.filter(tag => tag.count > 1)
}