Will you find this script useful?
Interesting idea. You should mention though, that you placed that button on https://www.steamgifts.com/account/manage/whitelist. I expected it on https://www.steamgifts.com/giveaways/new. ;)
Could you implement that functionality directly in the Steam store? You could directly fetch the appID from the open site and the benefits for the users should be obvious too.
Comment has been collapsed.
Some games Such as Death Road to Canada, show up as "null". But otherwise works well!
Comment has been collapsed.
Hey,
Work well here i use it With Opera and violentmonkey.
Thank you for your usefull script Gaffi !
i'll see one possible improvment
When i do a Blue heart GA i'd like to send some kind of "personal" invitation. Now, quite sure you see where it leads (◕‿-)✌
It would be amazing if there is a possibility to display the name of WL's members which owned the game.
BR
Comment has been collapsed.
Thanks for the feedback! As far as who has what, an earlier version (pre-release) painted a flag next to the user's name showing whether they owned it or not. This was only on one page at a time, however. I'll see if I can add to the output a report of the users who don't have the game yet.
Comment has been collapsed.
Hm. That works fine for me. Let me ask a few more questions:
Thanks, and I hope I can help get this working for you.
Comment has been collapsed.
I think I actually got it down to some network/slowness I let mine sit for a few minutes and it actually came up, but it took way too long. I'm not sure if that's my problem or not, but I've added a progress meter (on the button) so you should be able to see if it is actively moving or not. This doesn't actually fix anything; it just lets you know what's going on. To that end, I also added some extra verbosity to the console, which may help in identifying the root problem.
Comment has been collapsed.
Not bad, but without actual caching this concept is very slow and ineffective. You absolutely must keep wishlist of given user in a short-lived local cache, probably 24 hours would do (that's what I have in ArchiBoT). In addition to that it would make sense to also cache your wishlist to avoid cluttering SG servers. With those two enhancements, you can easily check multiple appIDs while only initial request will take time, everything else will be pulled from cache, and refresh if needed.
If you need some examples, check out my 2hu userscript (code, features won't work for you). I cache my API responses in short-lived cache for 15 minutes. This way my 2hu group members can easily view giveaway values without asking my API for data on each page being refreshed, otherwise it'd be killing my server. And I'm doing that for response as fast as this - caching wishlists is a must.
Comment has been collapsed.
Sorry, I don't mean to sound dense, but how is caching wishlist data going to help that much? If caching full user inventories, like SG does, might make some sense and I will certainly look into that for my code, but I'm failing to see why you point to wishlists explicitly?
Comment has been collapsed.
As always I was already going too far and I thought I suggested that already ;_;. In addition to showing how many users miss given game you could also implement indicator how many users wishlisted given title. And in this case you should cache games as well as wishlists. Pretty much what ArchiBoT is doing, just for your WL and not given group.
Comment has been collapsed.
:D Alright. Thank makes me feel better.
I had considered adding in wishlist checking, and I do think it would be useful to tie together for this purpose, but there are already some scripts out there to to that, so I didn't jump on it. Since I've made (I think, anyway) good progress on my own piece for now, I may just put wishlist checking on my to-do list.
Thanks for the feedback!
Comment has been collapsed.
Hi there, Archi! Thanks for the feedback, but I'm having some difficulty implementing a caching solution.
I am trying to use localStorage
to keep track of what has been previously loaded from the API, and I'm hitting QuotaExceededError
when I try to setItem
. I'm really not a master of HTML5/Javascript, so I'm hoping I'm just missing something obvious.
Right now, I'm stringifying JSON data to write to storage, but there is a relatively large amount of data to be stored (storing whole libraries/collections for ~100 users). I'm taking the raw Steam API data and compiling it together, and I imagine I could write my own JSON from scratch, keeping only the most basic, relevant bits (rather than extra things like play time), but I'm not sure if that will be enough to reduce below that maximum. Is there some other way to do or optimize this? Is there something else you would recommend?
I'm running this only on the user's machine; I do not have a hosted resource (like your justarchi.net) to store another DB or anything like that.
Thanks for your help.
Comment has been collapsed.
I don't know what limit is, but appIDs are stored as 32-bit unsigned integers (even lower if you apply actual steam masks and XOR, but hell please don't do that for your own sake).
https://arty.name/localstorage.html
5200000 characters were stored successfully, but 5300000 weren't.
Assuming appIDs are 6-characters (mostly), that gives you ability to store approx. 866.6 thousands of games, so over 8k per user if you have ~100. That should be enough. Actual limit will be a bit lower due to json structure, but you can do smart tricks such as storing json in base64 or any other format that takes less characters and decompress it, it's really easy and js already offers methods out of the box.
Apart from that, there is no way to do that with JS only. You can either use smart tricks and compress the data, or write your own API for managing cache. Assuming you don't want to do the second (nobody wants), you should stick with first option.
I'm not JS expert, I hate that language - I'm mostly coding backends in C# these days. But I'm sure there are ways to minify that json further, not only restructurizing it to contain only relevant info, but also compressing it using one method or another - cache is big enough, it's just a matter of proper logic.
Good luck.
Comment has been collapsed.
Compression actually sounds like a very good idea. I'm sure some zip-like algorithms would be really effective too, since there are so many repeated segments (i.e. appIDs owned by more than one user). Even then, base64 may be good enough to start with. I'll research that a bit more. Thanks for the guidance.
Comment has been collapsed.
I once read about GM_setValue, it doesn't have a limitation of variable size and number of variable can be stored.
But if there are too many variable stored, it'll slow down the script.
I once used each appID as a variable name for my script, so the script have thousands of variables stored, and it became slower the more appID stored.
I then use an array to store appID, convert it to json, and save it to 1 variable, e.g GM_setValue("data", "your_json")
Comment has been collapsed.
It is pretty simple to save data with GM_setValue("bundle-34900", true), GM_setValue("cards-34900", true), GM_setValue("achievements-34900", true)
But then again, 1 game has at least 5 variables, lol
I didn't knew it will slow down the script. :D
Every time the script runs, I pull the json and store it in an array
var GameData = GM_getValue("GameData", "");
GameData = JSON.parse(GameData);
And everytime GameData updated, I just need to update the GM value
GM_setValue("GameData", JSON.stringify(GameData));
Comment has been collapsed.
When I put the game id, nothing happens. Both in the SG and Steam Store. That progress button doesn't appear.
Comment has been collapsed.
I have 22 peoples on my WL. And i'm not familiar with javascript :( But I'll be glad if you teach me how to check the log output to send to you.
Comment has been collapsed.
You have less than one full page of a list, but that should not matter.
To get to the console, you can press F12, then at the top of the panel that appears, select Console
. It should be next to Elements
, but may be hidden behind >>
.
Open the console, reload the page (whether SG or Steam), try to run the function. The console should fill up with messages of all kinds (some may not be related to my code). Copy all of that and send to me (add me on Steam, or post on an old GA of mine if you like), or post an issue here: https://github.com/Gaffi/SG-WL-Inventory/issues
Once you're done, you can press F12 again to hide the panel.
Thanks for the debugging help!
Comment has been collapsed.
Comment has been collapsed.
would be nice since
swl.mabako.net seems to be down ;)
Comment has been collapsed.
Nice script. Very simple and easy to use.
Displaying details about ownership, such as who has a game (rather than only summary statistics)
This will be great if you can make it :D
Scanning wishlists for most wanted games
Isn't m0l0's Whitelist Wishlist and Tools already done this?
Comment has been collapsed.
Thank you!
For your second point, yes, there is already a script out there that does something like this, but mine would be a little different. For example, the other script lists the top wishlisted games, whereas mine will identify a specific game. Overall, my addition would just be another option, up to you which one you use.
Comment has been collapsed.
Correct. In current form, you supply a game ID (or run from a specific game's store page) and it returns the results.
I think the other script is more useful for finding what game to buy for your whitelist (if that is your aim), but mine is better to find out if a game you already have a key/gift for (say from a bundle or something) is likely to be well received by your WL.
Comment has been collapsed.
I hope you don't mind that I edited your script to better fit my needs. I moved the button to the left of the community button and changed the label to "SG♥" because I am using several scripts that add buttons and it's getting crammed.
In case anyone else is interested: Script
If you don't like that I will remove the link.
Comment has been collapsed.
Sounds like a good idea but the name Inventory Checker is misleading since it would check the Inventory for unredeemed gifts of that game. If I understood this correctly Libary Checker would be more accurate.
Comment has been collapsed.
can you move that default input number to a placeholder or something? as it is alert box, i understand difficulty, but that's a minus for me. on Linux I use thing, let's call it quick paste, where you select text somewhere and with middle mouse paste it without it going in to clipboard. the problem here is that, if i select that number in steam store link, opening your alert that default number selects over my steam selection and i'm pasting your default number. and as i can't switch tabs with your modal dialog, this happens every time.
Comment has been collapsed.
Came here to give my +1 for any inclusion of groups instead of only whitelists.
It would be extra-nice of you!!!!!!
Comment has been collapsed.
Very good! It will be veru useful for the whole community!
Comment has been collapsed.
Sorry sir, i didn't found the link on description, just a quick look =/
But thanks again!
Comment has been collapsed.
Damn, tried several times, but seems like Chrome is not accepting it... and when i clicked, gives a library error =/
Comment has been collapsed.
I was using Grease Monkey, but i forgot that i've uninstalled! Hahaha, gonna try again, sorry!
Comment has been collapsed.
thanks so much for your service to the community! this would be the tool that finally pushes me to try and figure out all of this userscript stuff when being able to check groups beyond whitelist is added. finally got bugged enough at the by-now obvious fact of swl's death... i bump from this thread
hopefully -
i stressed "when being able..." so much because i added it after the fact - did so to stress the edit... the comment didn't show as edited, but it will now... hangs head
oye dang, i commented the same a month ago... i promise i'm not hounding, i just saw this and yeah... well a bump is a bump? know that life gets in teh way and other things happen, i'm sorry
Comment has been collapsed.
Lol. Nice bump. ;) Do not worry, I do not feel hounded.
Adding the group stuff so far is actually working ok, but there are some design decisions I made that I need to rollback/change, which is unfortunately a bit of a mess. After that, I can then work on bugs, etc.
I'm sorry to keep everyone in suspense, but I'm getting there.
Comment has been collapsed.
lol. :)
Since there's a bump, I'll give a status update:
I added in some group functionality, but didn't love the implementation.
I changed the UI portion, and now having it working, except for some odd cases (usually has to do with group size).
I could probably release a buggy version now, but I'm trying to hold off until I have most/all of the big, obvious issues dealt with. Perhaps this week, given the time to do so. Real work calls this week, so I'm going to be less available to code, but I'm otherwise that close to release.
Comment has been collapsed.
unsure if it's supposed to be working on the steam store pages as well, but the button there isn't doing anything for me at all (see photo). works great from the steamgifts group page, but not there. if that section is only for whitelists then that would explain why it's broken for me though, since i have no whitelist.
Comment has been collapsed.
55 Comments - Last post 8 minutes ago by madjoki
252 Comments - Last post 16 minutes ago by WaxWorm
50 Comments - Last post 22 minutes ago by Kalzar
291 Comments - Last post 4 hours ago by JX8
795 Comments - Last post 8 hours ago by FranckCastle
364 Comments - Last post 8 hours ago by Zepy
44 Comments - Last post 9 hours ago by IronKnightAquila
640 Comments - Last post 20 seconds ago by Vampus
49 Comments - Last post 17 minutes ago by madjoki
32 Comments - Last post 20 minutes ago by viaI
95 Comments - Last post 27 minutes ago by Axelflox
16,914 Comments - Last post 30 minutes ago by MjrPITA
28,553 Comments - Last post 35 minutes ago by FranckCastle
41 Comments - Last post 57 minutes ago by BlaiddGwyn
SteamGifts Library Checker
Who has that game already? Who really wants it?
UPDATE:
I'm discontinuing support for this. I haven't had time, energy, or drive to focus on it, including some of the ever present functional bugs.
If you are looking to continue using the script, I won't disable it, but no guarantee it will work forever. You can always make your own fork if you are so inclined, but...
If you want another option, ESGST has nearly the same functionality and is much better supported (and has a plethora of other features baked in as well).
What's this about?
I was looking to give away some games to my whitelist and, to make it as worthwhile a giveaway as I could, I wanted to see how many people already had the game. If everyone on my list had it, it wouldn't be worth giving. Likewise if only 10 out of the list really wanted it (wishlisted), that's still not doing the greatest service to those on my list. There was no way I was going to manually look up every user to find out if the GA was going to be worth it.
I looked to see if there were any scripts out there to do this for me, but alas, there were none, so I set out to fix that. A few days into the process, someone else on the forums asked for the same thing. Well, that kicked me into higher gear to make something useful for anybody else who wanted this functionality, and at this point, I think it's ready to show. It may not be 100% yet, but good enough probably for most.
As the script has gotten use, there have been a few different additional suggestions for improvement and I've been trying to add them all in. I will continue to add features based on your feedback!
What does it do?
The script will scan through your whitelist or a group for an appID (only one game at a time, and no subs at this point), and report a count of how many in that list have it or want it, and what the ratio to the overall list size is. It will work from any active page of your WL or group page on SteamGifts, or from the Steam store for that particular app.
It will also work with m0l0's Whitelist Wishlist and Tools with no (obvious) conflicts, though your header may get a little crowded if you use both.
Steam API Key
The script uses the Steam API key (you can get yours here). From the Steam site, you can enter any value you like into the domain field (even invalid domain names), so long as nobody has already used it. Once done, you'll receive your API key. Plug this value into the appropriate field on the script's form and the rest should work without needing to re-enter it in the future. If there are errors, the script may prompt you to enter the API key again. If you've lost it, the API key should still be accessible to you via the link above.
Stop blabbing and let me at it!
You can get to the script HERE, and it should auto-update when I post changes, based on your userscript tool's update scheme.
How to use from SteamGifts:
How to use from Steam store:
Changes/Updates
/search?q=
page. Thanks, Tristar.@match
parameter from"http*://"
to simply"*://"
as the former worked with TamperMonkey, but not GreaseMonkey. (Thanks, Corran!)http
tohttps
in a few instances.Plans
Compatibility?
I have only personally tested on Chrome with Tampermonkey, but should also work with anything else.
If you use the script under other configurations, please let me know (whether there are issues or not!) so I can make a note of it. Also, if you find any bug, problems, or miscellaneous weirdness, please report them on the GitHub issue log.
Other feedback
If you have any other comments, suggestions, or other feedback, please share! I want to make this as useful and user-friendly as possible for all of you.
One last thing
I need to give a shout out to a few users in particular here:
Thanks guys!
Thanks also to everyone else who has offered suggestions for improving and whatever other feedback you have provided! I'm am slowly but surely adding in what I can and I appreciate the support from the community. <3
Comment has been collapsed.