A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

Lets say

1.2k views · started by 323 ·
#1
Lets say
I wanted to look at a list of items in my Gaia inventory, all using like HTTP wrappers, no gui or anything

Also known as, in a program, being able to click a button and have a list of every item in your inventory pop up.

How would one do this?

(Just the grabbing item names part, not the actual popping up in the program part)

I don't care what language, just give me a general idea of what I need to do, and I can probably do it in whatever language I decide to use.
#2
Let's not say.
#3
Let's not say.


Well how would I do it though? Isn't there SOME way? Maybe just utilizing GSI or something?
#4
1. login to gaia.
2. find request browser/client sends when items in your invo are displayed.
3. ???
4. profit.
#5
Like Int said, just log in and navigate to your inventory page, and parse the HTML to retrieve the names.
#6
Artificial wrote:
Like Int said, just log in and navigate to your inventory page, and parse the HTML to retrieve the names.


That's the trouble I'm having though. How would I parse the HTML like that? I only know the simplest of parsing, like by comma and line and stuff.
#7
That's the trouble I'm having though. How would I parse the HTML like that? I only know the simplest of parsing, like by comma and line and stuff.


???

Parsing would be any way to acquire or format certain data. Fairly simple technique. There's libraries like BeautifulSoup for Python and other generic HTML parsing libraries available for other languages. Libraries wouldn't be necessary if you know your way around these sorts of things though.

Look into string functions in standard libraries and regular expressions.
#8
???

Parsing would be any way to acquire or format certain data. Fairly simple technique. There's libraries like BeautifulSoup for Python and other generic HTML parsing libraries available for other languages. Libraries wouldn't be necessary if you know your way around these sorts of things though.

Look into string functions in standard libraries and regular expressions.


Well, lets pretend I have an inventory source: http://gaiaonline.com/chat/gsi/index.php?v=json&m=[[700]]

(GSI JSON ID number 700 fetches the currently logged in user's inventory)

So how would I parse that for ONLY the item names? I think I kinda sorta know, but not really.[/700]
#9
Uh, decode the JSON. You can either do this yourself or through the convenience of a library offered to you. Python has multiple JSON libraries.

You can either encode or decode something in the JSON format. In this case you would decode in order to receive a JSON object/array containing your desired results. This too is a form of parsing.
#10
Uh, decode the JSON. You can either do this yourself or through the convenience of a library offered to you. Python has multiple JSON libraries.

You can either encode or decode something in the JSON format. In this case you would decode in order to receive a JSON object/array containing your desired results. This too is a form of parsing.


Welp, I searched for a JSON encoder/decoder, and the best I could find was jsoncpp, but it looks complicated as hell to add into a project (I don't use visual studio, I use Code::Blocks, so everything is way harder to add to it) soooo I have no idea how to add it into my project :c
#11
Welp, I searched for a JSON encoder/decoder, and the best I could find was jsoncpp, but it looks complicated as hell to add into a project (I don't use visual studio, I use Code::Blocks, so everything is way harder to add to it) soooo I have no idea how to add it into my project :c


This is why you shouldn't be using C/C++ right now.
#12
This is why you shouldn't be using C/C++ right now.


Fuck you, it's not like it would get any simpler with any other language. It's just because of the dumbfuck open source free compiler.
#13
Fuck you, it's not like it would get any simpler with any other language. It's just because of the dumbfuck open source free compiler.


Python:

import simplejson as json
json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
print json.dumps("\"foo\bar")


Totally not simpler. Because of the fact that it's dynamic & on-the-fly. Because of the fact that Python is an interpreted language. Because of the fact that you aren't using fucking C++.

Blame it on the free and open source compiler why don't you. Be gone with you.
#14
Python:

import simplejson as json
json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
print json.dumps("\"foo\bar")


Totally not simpler. Because of the fact that it's dynamic & on-the-fly. Because of the fact that Python is an interpreted language. Because of the fact that you aren't using fucking C++.

Blame it on the free and open source compiler why don't you. Be gone with you.


Oh, I thought you were saying I shouldn't be using C++ because I "don't know it well enough". While it's partly true, it's better to try to get my hands dirty and actually learn something rather than take the easy way out. And I would love to use python, but I don't know it at all and currently don't have time to learn it :P
#15
Oh, I thought you were saying I shouldn't be using C++ because I "don't know it well enough". While it's partly true, it's better to try to get my hands dirty and actually learn something rather than take the easy way out. And I would love to use python, but I don't know it at all and currently don't have time to learn it :P

You're complaining about not knowing C/C++ then you complain you don't have the time to learn python. Python should take you like 2 hours to learn the syntax. Follow this guide for style of coding python and you're all good.

PEP 8 -- Style Guide for Python Code
#16
MattSmith wrote:
You're complaining about not knowing C/C++ then you complain you don't have the time to learn python. Python should take you like 2 hours to learn the syntax. Follow this guide for style of coding python and you're all good.

PEP 8 -- Style Guide for Python Code


Whatevz, may as well try.

Also hey, found something that might be of interest to you, it has to do with zOMG. Try to get on skype if you can, or just PM me I guess
#17
You could use regex to parse the text, but it's probably alot less efficient.