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

dimora-client

v0.1.0

Published

Unofficial client library for DiMORA

Downloads

3

Readme

node-dimora-client

Unofficial client module for DiMORA. It works on Node.js v8+.

npm Build Status


Notice

  • This software is published under testing phase.
  • This is unofficial software for the convenience of owners (and also Node.js engineers) of the TV-recorders connected with DiMORA.
  • I don't any guarantee about this software.
  • I don't have any relationship with the company of DiMORA or the vendors of the TV-recorders.

Get Started

1. Installation

Install this module and additional module for an example code.

$ npm install --save dimora-client readline-sync

2. Logging-in (Getting Session JSON)

This step is required when you perform operations requiring membership on DiMORA (such as recording reservation).

const LoginChallenger = require('dimora-client/libs/login-challenger');
const readlineSync = require('readline-sync');

// TODO: Put your Login ID and Login Password of DiMORA to here
const YOUR_LOGIN_ID = '';
const YOUR_LOGIN_PW = '';
// ------------------------------

// Start a challenge for login
let loginChallenger = new LoginChallenger((error, captcha_img_buffer) => {

	if (error) {
		console.error(error);
		process.exit(1);
	}

	// Save the CAPTCHA image
	console.log(`CAPTCHA image was saved to ${__dirname}/tmp-captcha.jpg`);
	require('fs').writeFileSync(`${__dirname}/tmp-captcha.jpg`, captcha_img_buffer);

	// You need to enter the answer the CAPTCHA image while at this challenge
	const captcha_answer = readlineSync.question('Input an answer of CAPTCHA: ');
	console.log(captcha_answer);

	// Finish the challenge with your login ID, password and an answer of CAPTCHA
	loginChallenger.finish(YOUR_LOGIN_ID, YOUR_LOGIN_PW, captcha_answer, (error, session_json) => {

		if (error) {
			console.error(error);
			process.exit(1);
		}

		// NOTE: You can skip challenge from next time by use this Session JSON
		console.log(`Your challenge was successful.\n Here is Session JSON: \n---------------\n${session_json}\n`);

	});

});

3. Searching for TV Program and Recording Reservation

const DimoraClient = require('dimora-client');
const readlineSync = require('readline-sync');

// TODO  Put your Session JSON acquired in step 2 to here
const YOUR_SESSION_JSON = null;
// ------------------------------

// Initialize the Client with the Session JSON
const client = new DimoraClient(YOUR_SESSION_JSON);

// Now, you can searching for TV program on DiMORA
console.log('Let\'s searching TV schedules.');
const search_keyword = readlineSync.question('Input a keyword: ');

client.tvSchedules.fetch({
	channelTypes: ['TE', 'BS', 'CS'], // 'TE' (地デジ), 'BS' (BSデジ), 'CS' (CSデジ)
	keyword: search_keyword
}, (error, tv_schedules) => {

	if (error) {
		console.error('error: ', error);
		process.exit(1);
	}

	// Display the search results
	tv_schedules.forEach((tv_schedule, i) => {
		console.log(`[${i}] ${tv_schedule.getStartDate()} - ${tv_schedule.getTitle()} (${tv_schedule.getBroadcasterName()})`);
	});

	// Of course, you can also make a Reservation Recording on your recorder
	console.log('Which programs do you record?');
	const record_index = readlineSync.question('Input an ID: ');

	if (record_index.match(/^[0-9]+$/) && tv_schedules[parseInt(record_index)]) {

		const tv_schedule = tv_schedules[parseInt(record_index)];

		console.log(`Making reservation... ${tv_schedule.getTitle()}`);
		tv_schedule.recordOnce((error) => {

			if (error) {
				console.error('error: ', error);
				process.exit(1);
			}

			console.log(`OK! ${tv_schedule.getTitle()} will be recorderd`);

		});

	}

});

API Documents

https://mugifly.github.io/node-dimora-client/DimoraClient.html


Trademarks of Third Party

  • "DiMORA" is a trademark of Panasonic Coporation.

License

The MIT License (MIT)
Copyright (c) 2017 Masanori Ohgita