andrscrrn / tumblr-lks-downldr

Node module for downloading Tumblr liked posts from an specific user.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tumblr-lks-downldr

Travis Codecov NPM Downloads Total Commitizen Friendly Semantic Released

Simple node module for downloading your precious Tumblr likes.

A few things for having in mind while using it:

  • This will save just image files and not any other kind of content.
  • Images are saved with the filenames given by Tumblr unless the attribution parameter is set to true (see below).
  • The number of postsToLoad it likely NOT going to be the same as the number of images that you will get. Posts can have more than one image or not having any image AT ALL.
  • The maximum value for postsOffset is 1000 (this is a limitation of the Tumblr API).
  • If the attribution parameter is set to true, images will be renamed in the form "{blogname}_{timestamp}" and a .txt file with the like's textual content will be created using the same name (i.e. 'blogpost_123456_0.jpg' will have its note saved as 'blogpost_123456.txt').
  • The postsToLoad parameter will work for the latests post. For example: If you set a limit of 100, you'll get the latest 100 posts from you account. This can be useful if you already ran the utility before and your intention is just to update the folder with the latests posts.

How to use

Install the module as a dependency in your project:

npm i tumblr-lks-downldr --save

Require it into your project:

const tumblrLksDownldr = require('tumblr-lks-downldr');

Then you can interact with it using the setGlobalParams and getLikedPosts methods:

tumblrLksDownldr.setGlobalParams(
  {
    url: 'yourblog.tumblr.com',
    postsToLoad: '10',
    postsOffset: '10',
    attribution: true,
    path: 'some-path-you-want',
    onStart: (info) => {
      console.log('onStart:', info);
    },
    onFetch: (info) => {
      console.log('onFetch:', info);
    },
    onDownloadStart: (info) => {
      console.log('Download start:', info);
    },
    onSuccess: (info) => {
      console.log(`${info.fileName} succeed!`);
    },
    onError: (error, info) => {
      console.log(`${info.fileName} failed!`);
    },
    onComplete: () => {
      console.log('Complete!');
    }
  }
);
tumblrLksDownldr.getLikedPosts();

I want a functionality that is not supported. What can I do?

Well, you can ask for it as an issue and depending on my available time, I can see how feasible it is. At that point the idea can be added as a To-Do itemor just get closed if it is not following our expectations with the module.

Do I really need to create a javascript file to use this?

Yes and no. For this specific module yes but if you want to use it as a CLI tool you can use tumblr-lks-downldr-cli that is basically a wrapper.

Issues

I'm working on this module once on a while but if you find out any issue please report it here.

About

Node module for downloading Tumblr liked posts from an specific user.

License:MIT License


Languages

Language:JavaScript 100.0%