Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other attributes #11

Open
Aoize opened this issue Jul 14, 2020 · 3 comments
Open

Other attributes #11

Aoize opened this issue Jul 14, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Aoize
Copy link

Aoize commented Jul 14, 2020

This isn't so much an issue but more a curiosity. I am currently making a discord bot that reads the data from the projected .csv file that your program helps to create. I am wondering if it's possible to obtain data such as; listed price(s) for an item?

@kookehs
Copy link
Owner

kookehs commented Jul 14, 2020

By listed prices do you mean player listings to either buy or sell an item? If so the data is obtainable.

https://github.com/kookehs/bdo-marketplace/blob/master/collector.go#L93
The above iterates over the market conditions to find the max and min prices, since the price list doesn't include it all.
It can be modified to spit out the desired data. I haven't put much thought into how to output the data. Create a separate CSV for each item with market conditions? Same goes for the historical data.

An example for Beer.

"marketConditionList": [
        {
            "sellCount": 0,
            "buyCount": 500,
            "pricePerOne": 2220
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2230
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2240
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2250
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2260
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2270
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2280
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2290
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2300
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2310
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2320
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2330
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2340
        },
        {
            "sellCount": 3500,
            "buyCount": 0,
            "pricePerOne": 2350
        },
        {
            "sellCount": 83,
            "buyCount": 0,
            "pricePerOne": 2360
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2370
        },
        {
            "sellCount": 1179,
            "buyCount": 0,
            "pricePerOne": 2380
        },
        {
            "sellCount": 5900,
            "buyCount": 0,
            "pricePerOne": 2390
        },
        {
            "sellCount": 1078,
            "buyCount": 0,
            "pricePerOne": 2400
        },
        {
            "sellCount": 1156,
            "buyCount": 0,
            "pricePerOne": 2410
        },
        {
            "sellCount": 4490,
            "buyCount": 0,
            "pricePerOne": 2420
        },
        {
            "sellCount": 2382,
            "buyCount": 0,
            "pricePerOne": 2430
        },
        {
            "sellCount": 51,
            "buyCount": 0,
            "pricePerOne": 2440
        },
        {
            "sellCount": 1919,
            "buyCount": 0,
            "pricePerOne": 2450
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2460
        },
        {
            "sellCount": 3506,
            "buyCount": 0,
            "pricePerOne": 2470
        },
        {
            "sellCount": 1953,
            "buyCount": 0,
            "pricePerOne": 2480
        },
        {
            "sellCount": 7736,
            "buyCount": 0,
            "pricePerOne": 2490
        },
        {
            "sellCount": 11154,
            "buyCount": 0,
            "pricePerOne": 2500
        },
        {
            "sellCount": 10900,
            "buyCount": 0,
            "pricePerOne": 2510
        },
        {
            "sellCount": 16591,
            "buyCount": 0,
            "pricePerOne": 2520
        },
        {
            "sellCount": 2201,
            "buyCount": 0,
            "pricePerOne": 2530
        },
        {
            "sellCount": 4848,
            "buyCount": 0,
            "pricePerOne": 2540
        },
        {
            "sellCount": 11367,
            "buyCount": 0,
            "pricePerOne": 2550
        },
        {
            "sellCount": 13604,
            "buyCount": 0,
            "pricePerOne": 2560
        },
        {
            "sellCount": 2436,
            "buyCount": 0,
            "pricePerOne": 2570
        },
        {
            "sellCount": 0,
            "buyCount": 0,
            "pricePerOne": 2580
        }
    ]

@kookehs kookehs self-assigned this Jul 14, 2020
@kookehs kookehs added the enhancement New feature or request label Jul 14, 2020
@Aoize
Copy link
Author

Aoize commented Jul 14, 2020

Ahh i see, what would I need to do, to output that data? Would i need to edit the collector.go +/ json file to give me it?

@kookehs
Copy link
Owner

kookehs commented Jul 14, 2020

Yup, you could add a file write before or after the for loop. The struct already has JSON tags, if you wanted JSON as output.
Something along the lines of this, but modify the file name depending on the variations of items or group them all together.

data, _ := json.Marshal(gisbi.MarketConditionList)
ioutil.WriteFile(v.Name + ".json", data, os.ModePerm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants