Coder Social home page Coder Social logo

Comments (21)

marlop352 avatar marlop352 commented on August 24, 2024

isn't that the same as filtering the owned tag/category using the giveaways filter?

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Giveaway Filters already does this.

from esgst.

Revadike avatar Revadike commented on August 24, 2024

Differently, but ok.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

How is it different? Doesn't it just hide those giveaways the same way the filters do? I didn't check the code of the script, just read your description.

from esgst.

Revadike avatar Revadike commented on August 24, 2024

I think this request is still valid. I am pretty sure you are doing it differently. I am talking about hiding games and DLC through steamgift's hide giveaway feature. For that you need the steamgift's native gameid. But if you want to hide all owned (gathered from steam userdata), you need appid/subid to gameid conversion, which my API is the only one that provides this: https://royalgamer06.ga/sgdb.json
Just check the code of my script and it will make more sense.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Sorry, back then I didn't understand that you were talking about SteamGifts' filter list, but this has already been implemented in Multi-Manager (actually 10 days ago xD): https://github.com/gsrafael01/ESGST/blob/master/src/modules/General/MultiManager.js#L1085

But there's no single-click way to hide all owned games at the moment, although I can implement that. Currently you have to either go to your owned games page on SteamGifts and use the feature there or get store links to all of the games in your account and give them to the feature.

I use SteamGifts' new giveaway search to retrieve game IDs (as you can see in the function linked above), but I could add your API as the primary method if it's reliable. Though I guess it's the same thing (1 request).

from esgst.

Revadike avatar Revadike commented on August 24, 2024

Yes, it's reliable and I use the same way of collecting/retrieving the ID's. My bot scans steamgifts archive periodically for any new giveaway games and then requests/updates the ID's. I do this so individuals don't have to and therefore will reduce the load on steamgifts significantly. Why?

  • Obviously, you won't use steamgifts servers but mine
  • You will request way less junk data (like HTML), making everything more efficient
  • You could cache the API result

This is exactly why I made this API in the first place. Not just for my script, but anyone that could make use of it and reduce load on steamgifts.

And yes, like my userscript does, it gets the owned steam store id's (appids) from https://store.steampowered.com/dynamicstore/userdata/ and use that data combined with my game id database to hide all owned apps. I suggest you check out my userscript's code, it's easy code.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Ok, I'll add your API as the primary method then.

I don't need to check the code, ESGST already has all the logic in place. :)

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

From initially looking at the API, I see this:

45420: 1431836977

Is it correct? I don't think Steam has ids that long, it looks like a date timestamp.

from esgst.

Revadike avatar Revadike commented on August 24, 2024

That is correct. Just check yourself by searching for that game when creating a giveaway and then view the source.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Yeah, I got confused, I thought 45420 was the SteamGifts id and 1431836977 was the Steam id, but it's the other way around. What is gameids for?

from esgst.

Revadike avatar Revadike commented on August 24, 2024

That's just the reverse.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

But can't the reverse be appids and subids?

from esgst.

Revadike avatar Revadike commented on August 24, 2024

But can't the reverse be appids and subids?

what do you mean?

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

There are 4 possible mappings:

Steam appid => SteamGifts id
Steam subid => SteamGifts id
SteamGifts id => Steam appid
SteamGifts id => Steam subid

The gameids object is mapping SteamGifts ids to what? Steam appids or subids? They can be both, so you'd have to separate them.

from esgst.

Revadike avatar Revadike commented on August 24, 2024

yes both and they are already separated
you could do:
Object.keys(json.appids).includes(json.gameids[gameid]) ? "appid" : "subid";

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Problem is appids and subids can have the same id. Let's say there's an entry like this in gameids:

"20": "50200"

And let's say appids has an entry like this:

"50200": "100"

And let's say subids has an entry like this:

"50200": "20"

It would incorrectly detect 20 as the appid 50200, when, in fact, 20 is the subid 50200.

I don't know if you understand what I'm saying. Occurrences like this are a bit rare, but they exist, I used to not differentiate between appids and subids on ESGST because I thought they were unique, until I found an id that was the same.

from esgst.

Revadike avatar Revadike commented on August 24, 2024

Yes, I see the problem, but this is rare and 90% of all ID's are appids, so the best guess will be appid.
However, I don't really see why you would need to know this anyway.
Wouldn't you just get the list of appids and the list of owned subs from steam userdata?
Then just use the different categories to get the sg gameid for hiding it.
You shouldn't use my endpoint to differentiate subids from appids anyway.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

Even if it was 99.99%, there would be no harm in separating them to prevent issues, it's very easy to just use the format { "id": "20", "type": "apps" }.

For hiding games, I'm already using your endpoint and it's all sorted out.

But I was also going to use your endpoint for something else, when a giveaway doesn't have the Steam id on SteamGifts, but has the attribute data-game-id. In that case, I could use the reverse method to get the Steam id of the game. But since the gameids endpoint is not 100% accurate, I cannot use it.

It's just a suggestion, I'm currently using whitelist filters to get the Steam ids of those games (see #1077).

from esgst.

Revadike avatar Revadike commented on August 24, 2024

No, it would be redundant. You could for example do this:
"SteamGifts GameID " + gameid + " is a Steam " + (Object.entries(json.appids).includes(gameid) ? "Appid" : "Subid")
This is different from the previous example.

from esgst.

rafaelgomesxyz avatar rafaelgomesxyz commented on August 24, 2024

It's not redundant.

Using the reverse method to get a Steam id from a SteamGifts id (if it was in the format I mentioned):

steam_obj = json.gameids[game_id];
if (steam_obj) {
  steam_id = steam_obj.id;
  steam_type = steam_obj.type;
}

Using the regular method:

steam_id = Object.keys(json.appids).filter(x => json.appids[x] == game_id)[0];
if (steam_id) {
  steam_type = "apps";
} else {
  steam_id = Object.keys(json.subids).filter(x => json.subids[x] == game_id)[0];
  if (steam_id) {
    steam_type = "subs";
  }
}

First method is much nicer.

But anyway, like I said, it was just a suggestion to make the endpoint 100% accurate, but clearly you don't agree, so nevermind.

from esgst.

Related Issues (20)

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.