1.0.2 • Published 2 years ago

steam-profile-api v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Steam Profile Api

Get Steam profile data with cheerio

Using

import SteamProfile from 'SteamProfile';

const steamHtml = await fetch("https://steamcommunity.com/id/"+steamid).then(res=>res.body.json())

const profile = new SteamProfile(steamHtml);
const StatusData = profile.getStatus();
console.log(StatusData);
// return status, status game information, status text

or

import {getStatus} from 'SteamProfile';

const steamHtml = await fetch("https://steamcommunity.com/id/"+steamid).then(res=>res.body.json())

const StatusData = getStatus(steamHtml);
console.log(StatusData);
// return status, status game information, status text

getCostumeUser Flags

  • selectUser:
    • status
    • userInfo
    • recentGames
  • showcaseSelect
    • favoriteGame

Example:

import {getCostumeUser} from 'SteamProfile';

const userDataWithPlus = getCostumeUser("+status","favoriteGame","steamHtml");
console.log(userDataWithPlus)
// return UserComponents:status, ShowCaseComponents:favoriteGame

const userDataWithouPlus = getCostumeUser("-userInfo, recentGames","favoriteGame","steamHtml");
console.log(userDataWithouPlus) 
// return UserComponents:status, ShowCaseComponents:favoriteGame

TO Do

  • write test file
  • add other special components
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago