Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discotify

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discotify - npm Package Compare versions

Comparing version 0.2.10 to 0.2.11

spotify-webhelper/spotify.ts

30

index.ts
#!/usr/bin/env ts-node
import * as DiscordRPC from 'discord-rpc';
import * as logger from 'winston';
import axios from 'axios';
import { platform } from 'os';
const DiscordRPC = require('discord-rpc');
const logger = require('winston');
const axios = require('axios');
const { platform } = require('os');
const nodeSpotifyWebhelper = require('./spotify-webhelper/spotify');
const [, , ...args] = process.argv;
let nodeSpotifyWebhelper;
if (platform().toString() === "win32") {
nodeSpotifyWebhelper = require('./spotify-webhelper/windows');
} else {
nodeSpotifyWebhelper = require('./spotify-webhelper/linux');
}
const spotify = new nodeSpotifyWebhelper.SpotifyWebHelper();
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const clientID = '383639700994523137';
let compareURI: string;
let compare: boolean;
let compareURI;
let compare;

@@ -34,3 +28,3 @@ logger.configure({

spotify.getStatus((err: Error, res: any) => {
spotify.getStatus((err, res) => {
if (err) return logger.error(err.stack ? err.stack : err.toString());

@@ -82,6 +76,6 @@ if (!res.track || !res.track.track_resource) return logger.warn(`(${new Date().toLocaleTimeString()}) No track data, make sure Spotify is opened and a song is selected!`);

function checkVersion() {
let sVersion: string = require('./package.json').version;
let sVersion = require('./package.json').version;
let version = ~~(require('./package.json').version.split('.').join(''));
axios.get('https://raw.githubusercontent.com/KurozeroPB/discotify/master/package.json')
.then((res: any) => {
.then((res) => {
if (res.status !== 200) {

@@ -94,3 +88,3 @@ return logger.error(`Failed to check for updates: ${res.data}`);

}
}).catch((err: any) => {
}).catch((err) => {
logger.error(err.stack ? err.stack : err.message ? err.message : err.toString());

@@ -111,3 +105,3 @@ });

rpc.login(clientID)
.catch((err: Error) => logger.error(err.stack ? err.stack : err.toString()));
.catch((err) => logger.error(err.stack ? err.stack : err.toString()));
} else {

@@ -114,0 +108,0 @@ console.log(`

2

package.json
{
"name": "discotify",
"version": "0.2.10",
"version": "0.2.11",
"description": "Discord Rich Presence for spotify in TypeScript",

@@ -5,0 +5,0 @@ "homepage": "https://kurozero.xyz",

@@ -1,2 +0,2 @@

# discotify `0.2.10`
# discotify `0.2.11`
Spotify Rich Presence for Discord in TypeScript<br/>

@@ -6,3 +6,3 @@ *shows your currently playing song as a fancy rich presence in Discord*

Install globally with:<br/>
`npm install -g discotify@0.2.10`
`npm install -g discotify@0.2.11`

@@ -9,0 +9,0 @@ ## Requirements

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc