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

customurl2steamid64

v1.1.0

Published

VERY simple NodeJS module to get a user's steamID64 based on customURL. No API key needed

Downloads

16

Readme

customurl2steamid64

VERY simple NodeJS module to get a user's steamID64 based on customURL. No API key needed.

What's this for?

This module will allow you to get the SteamID64 for any Steam player, as long as the target profile is public.

But why?

I couldn't find this utility for a project I'm working on, so I decided to write it myself and learn some NodeJS in the process.

Is this officially supported?

Not by Valve Software by any means. I'm just a fan. I'll try to support development of this library for as long as I can

Cloning

$ git clone https://github.com/yllanos/customurl2steamid64.git

Installing

Using npm:

$ npm install customurl2steamid64

Testing

$ node test.js

(You should get this number on your console): 76561198008252756

You could also alter this file on variable 'username' to whatever Steam user you wish to test

Integration example (steam-web)

Using the test file above as template, we are going to integrate with the steam-web library. Please update your code with your own API key

var getSteamID64 = require('../lib/steamid64');
var steam = require('steam-web');

var username = 'yllanos';
var baseURL = "http://steamcommunity.com/id/";
var URL = baseURL + username +  "/?xml=1";

var s = new steam({
  apiKey: 'XXXXXXXXXXXXXXXX', // <<--PROVIDE API KEY HERE
  format: 'json' //optional ['json', 'xml', 'vdf']
  });

/**
* Example implementing steam-web
* If you want to test a different user, just edit the 'username' variable as needed
* Don't forget to add your own Steam API key
* 'result' variable represents the value to be integrated into your application
* @param {string} URL - Full URL profile for specific user.
*/
getSteamID64(URL)
.then(function (result) {

    s.getPlayerSummaries({
      steamids: [result],
      callback: function(err, data) {
        console.log(data["response"]["players"]);
      }
    })
  })
.catch(function (reason) {
    console.error("%s; %s", reason.error.message, reason.options.url);
    console.log("%j", reason.response.statusCode);
    return reason.error.message;
});

When the code above is executed, you should get something like:

[ { steamid: '76561198008252756',
    communityvisibilitystate: 3,
    profilestate: 1,
    personaname: 'Soyvideojuegos',
    lastlogoff: 1458067862,
    profileurl: 'http://steamcommunity.com/id/yllanos/',
    avatar: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/36/3695d435209ad73d6ed0f720ac68f5c809a8e514.jpg',
    avatarmedium: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/36/3695d435209ad73d6ed0f720ac68f5c809a8e514_medium.jpg',
    avatarfull: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/36/3695d435209ad73d6ed0f720ac68f5c809a8e514_full.jpg',
    personastate: 0,
    realname: 'Yamil Llanos',
    primaryclanid: '103582791434470617',
    timecreated: 1237920338,
    personastateflags: 0,
    loccountrycode: 'CO',
    locstatecode: '04',
    loccityid: 10644 } ]