Coder Social home page Coder Social logo

cilginsinek / steam-profile-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 199 KB

Steam Profile API with CheerioJS

Home Page: https://www.npmjs.com/package/steam-profile-api

License: MIT License

TypeScript 99.69% JavaScript 0.31%
cheerio npm-package typescript

steam-profile-api's Introduction

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
  • write miniprofile functions
  • add other special components

steam-profile-api's People

Contributors

cilginsinek avatar

Watchers

 avatar

steam-profile-api's Issues

Avatar Source cant find

getUserInfo(){
      ....

      const name: string = $("bdi").first().text();
      const nickname: string = $(".actual_persona_name").first().text();
280  const avatar: string = $(".playerAvatarAutoSizeInner")
        .children()
        .attr("src");

change 281 => .children("img")

Class can't work use function for now

File:

import axios from 'axios';
import steamUser from 'steam-profile-api';

const steamHtml = await axios.get("https://steamcommunity.com/id/CilginSinek").then(res => res.data);

const steam = new steamUser(steamHtml);

console.log(steam.getStatus());

Error:

file:///D:/Projects/hebele/hebele.mjs:6
const steam = new steamUser(steamHtml);
              ^

TypeError: steamUser is not a constructor
    at file:///D:/Projects/hebele/hebele.mjs:6:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

fix class

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.