NATION

PASSWORD

Easy Trading Cards bids/auction checker

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Easy Trading Cards bids/auction checker

Postby Mackiland » Mon Oct 18, 2021 3:13 pm

I've been working on this project ''NS cards''.

You can see if any of cards you own are on an auction at that moment.

And you can see if there are any bids on any of your cards higher than the cards MV or junk price!

The code needs lots of polishing and I need to work on exception handlings and make sure rate limit isn't violated.

But now it does seem to work.

Check it out here:

NS cards

I'd be happy to hear some feedback and suggestions! :)


UPDATES:

21/10/2021 :

* I removed the auction checker as it was quite useless. You could indeed get the same info from the main website.
* I polished up the code.
* I handled the rate limit (thanks to Wolfram and Hart's code. see it here)
* Now the tools creates a fancy table to display results. (thanks to All Wild Things's suggestion)
* You can see the card names instead of IDs. (thanks to All Wild Things's suggestion)
* Updated the address. now it's "makrine.github.io/NScards" instead of "makrine.github.io/NScards2". There was 2 for some silly reason. (The tool url above is, of course, updated).
Last edited by Mackiland on Thu Oct 21, 2021 7:30 am, edited 4 times in total.
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
Comfed
Minister
 
Posts: 2255
Founded: Apr 09, 2020
Psychotic Dictatorship

Postby Comfed » Mon Oct 18, 2021 8:00 pm


User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Mon Oct 18, 2021 10:37 pm




Oh no, that page shows if YOU have made any bids or asks. It doesn't show you if anyone made a bid on the cards you own.
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
All Wild Things
Diplomat
 
Posts: 526
Founded: Apr 24, 2017
Inoffensive Centrist Democracy

Postby All Wild Things » Tue Oct 19, 2021 3:39 am

Good stuff. Get that rate limit sorted though! ;)

The Auction Checker seemed to duplicate this:
https://www.nationstates.net/page=deck/ ... s=auctions
I don't know that I'd use it, but an enhancement could be to check a list of puppets for active auctions. That would save the effort of logging in to each account.

The Bids Checker is cool. I found some bids that I hadn't expected to see.
I think I'd have made the output more tabular, like the main site Market page.
So each row could have the link, id, season, rarity / junk price, MV, and highest bid (and lowest ask if it's easily available?). Not sure that I'd be interested in all the other lower bids that come up just now (other players may disagree).
Another nice touch would be if the card name could be returned instead of the id.
Browse The NewsStand
Watch the Wild Life

User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Tue Oct 19, 2021 4:43 am

All Wild Things wrote:Good stuff. Get that rate limit sorted though! ;)

The Auction Checker seemed to duplicate this:
https://www.nationstates.net/page=deck/ ... s=auctions
I don't know that I'd use it, but an enhancement could be to check a list of puppets for active auctions. That would save the effort of logging in to each account.

The Bids Checker is cool. I found some bids that I hadn't expected to see.
I think I'd have made the output more tabular, like the main site Market page.
So each row could have the link, id, season, rarity / junk price, MV, and highest bid (and lowest ask if it's easily available?). Not sure that I'd be interested in all the other lower bids that come up just now (other players may disagree).
Another nice touch would be if the card name could be returned instead of the id.


thank you so much for the feedback!

All Wild Things wrote:The Auction Checker seemed to duplicate this:
https://www.nationstates.net/page=deck/ ... s=auctions


I might be wrong but I believe that page shows whether you are participating in any auctions. But my Auction Checker shows whether auction is happening to the cards that you own.
For example, right now your nation auction link shows 0 auctions however my auction checker shows that there is an auction going on one card you own:
Image


All Wild Things wrote:I think I'd have made the output more tabular, like the main site Market page.
So each row could have the link, id, season, rarity / junk price, MV, and highest bid (and lowest ask if it's easily available?). Not sure that I'd be interested in all the other lower bids that come up just now (other players may disagree).


I like that idea! I will work on that!!

All Wild Things wrote:Another nice touch would be if the card name could be returned instead of the id.


I thought about that too but the thing is for that I need to make MORE requests as that data isn't available in the xml files that I am using which doesn't work well with the rate limit.
I am thinking that I'll just remove that ID too and just keep the link there to the card.

OR I just need to make a HUGE list of ALL the cards with their names and IDs and I could get that data from there. But this sounds like a lots of work because there are too many cards.

All Wild Things wrote:Get that rate limit sorted though!


that is very true! I hadn't worked with JavaScript before so I am kind of confused how to do stuff there (my code needs lots of polishing up too!)
but I will work on that.
Last edited by Mackiland on Tue Oct 19, 2021 4:51 am, edited 1 time in total.
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
9003
Diplomat
 
Posts: 624
Founded: Oct 25, 2012
Corporate Police State

Postby 9003 » Tue Oct 19, 2021 7:20 am

OR I just need to make a HUGE list of ALL the cards with their names and IDs and I could get that data from there. But this sounds like a lots of work because there are too many cards.


In the data dumps there is an XML file with all of the cards info for each season. You could use it quite easily.



As for fixing the rate limit try having it run locally similar to how NS login by aurella does it.
Last edited by 9003 on Tue Oct 19, 2021 7:22 am, edited 1 time in total.
proud member of PETZ people for the Ethical Treatment of Zombies

Active member of The cards market place discord

User avatar
Attike
Secretary
 
Posts: 32
Founded: Apr 18, 2020
Ex-Nation

Postby Attike » Tue Oct 19, 2021 7:27 am

I've bookmarked this! It's quite useful, as my cards won't stop proliferating and it's already becoming annoying to check if they're all correctly set up.

User avatar
All Wild Things
Diplomat
 
Posts: 526
Founded: Apr 24, 2017
Inoffensive Centrist Democracy

Postby All Wild Things » Tue Oct 19, 2021 10:47 am

Ah! So I'd misunderstood the purpose of the Auction Checker.

I've not looked at your code yet, but I'm guessing that for the Bids Checker you're pulling the "markets" shard for each card? If so, you could try and combine with the "info" shard, like this:
https://www.nationstates.net/cgi-bin/ap ... 1;season=1

That way you could get the card name included (I think!)
Browse The NewsStand
Watch the Wild Life

User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Tue Oct 19, 2021 11:07 am

All Wild Things wrote:Ah! So I'd misunderstood the purpose of the Auction Checker.

I've not looked at your code yet, but I'm guessing that for the Bids Checker you're pulling the "markets" shard for each card? If so, you could try and combine with the "info" shard, like this:
https://www.nationstates.net/cgi-bin/ap ... 1;season=1

That way you could get the card name included (I think!)



OHHH! That is genius! :D Why didn't I think of that! I forgot that I could combine it like that! Thanks a lot!!
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Tue Oct 19, 2021 11:17 am

9003 wrote:In the data dumps there is an XML file with all of the cards info for each season. You could use it quite easily.


Oh really? That sounds useful. But I think I will do what All Wild Things suggested (combining shards together). It doesn't add any new request and I prefer to get the data from just one xml file.


As for fixing the rate limit try having it run locally similar to how NS login by aurella does it.


Thanks, I will look into it!
Last edited by Mackiland on Tue Oct 19, 2021 11:19 am, edited 1 time in total.
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
9003
Diplomat
 
Posts: 624
Founded: Oct 25, 2012
Corporate Police State

Postby 9003 » Tue Oct 19, 2021 6:04 pm

Ran into an interesting corner case that may only affect me but when entering a deck with 280,000 cards it gives me an error :p

Bid checker also seems to do asks btw
Last edited by 9003 on Tue Oct 19, 2021 6:17 pm, edited 1 time in total.
proud member of PETZ people for the Ethical Treatment of Zombies

Active member of The cards market place discord

User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Tue Oct 19, 2021 11:38 pm

9003 wrote:Ran into an interesting corner case that may only affect me but when entering a deck with 280,000 cards it gives me an error :p

Bid checker also seems to do asks btw



Could you please tell me about the error?

Do you mean it also shows the asks? I do have a function which does asks too but I never call it. What do you mean?
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation

User avatar
Mackiland
Spokesperson
 
Posts: 193
Founded: Feb 15, 2020
Iron Fist Consumerists

Postby Mackiland » Thu Oct 21, 2021 7:32 am

I did some updates!

See the very first post!
A very cool person
"Some meaningful quote that could change your life" ~ a wise philosopher

I make some tools for NS
Pro: crastination

Mackiland factbook
Con: stipation


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: 9003, Aurora Islands, ImperialRussia, Improper Classifications, New Flamington, Sto Lat, Stratocratic-Anarchy Oceanic Empire, The Terren Dominion, Thermodolia, Tungstan

Advertisement

Remove ads

cron