Shop Analyzing Help

Discuss all kinds of software here including apps, games and operating systems. You can also share software guides and receive help for your software in this section.
User avatar
EmberCelica
Engineer
Engineer
CPU: i7 6700k
RAM: 16GB DDR4
Motherboard: [Unknown]
GPU: AMD RX480
Cooling: Fan Cooling
Location: Always behind you
Posts: 188
Joined: Sat Feb 28, 2015 11:20 pm

Shop Analyzing Help

Mon Dec 07, 2015 5:55 am

Im not quite sure what im doing wrong. I log in successfully, based on the logs. But everything comes to a complete halt when i get to here:

Code: Select all

var doc = XmlService.parse(html)
all the code before is just the login code which i can see works, becuase i return the full html, with the discount, player name, and etc when i do this:

Code: Select all

  var html = UrlFetchApp.fetch(shopurl,options).getContentText();
  Logger.log(html)
and it will not get passed the xml.
I looked at alot of pages involving parsing HTML and that is how they were saying to do it, with a few other things.
Every time it errors it returns this:
Error on line 133: The element type "meta" must be terminated by the matching end-tag "</meta>". (line 9, file "Shop Analyzer")
Which i presume, is a meta tag that isnt closed. I do not expect anything as far as editing the HTML, but i was wondering if there is a way to work around this while still parsing the code. Its giving me a headache really, and i kinda wanna make some progress on this.
PS: the "Line 9, file shop analyzer" is my script, line 133 is your html btw.

If it wasnt for the fact it lies outside of my code, i would most liekly be able to solve it, but this way its faster.
Image
Image Im the engineer of engineers.
Check out my redstone info thread
User avatar
Pri
Site Admin
Site Admin
Posts: 5433
Joined: Fri Dec 14, 2007 8:59 am

Re: Shop Analyzing Help

Mon Dec 07, 2015 6:40 am

What parts of the shop page are you wanting to parse?
User avatar
EmberCelica
Engineer
Engineer
CPU: i7 6700k
RAM: 16GB DDR4
Motherboard: [Unknown]
GPU: AMD RX480
Cooling: Fan Cooling
Location: Always behind you
Posts: 188
Joined: Sat Feb 28, 2015 11:20 pm

Re: Shop Analyzing Help

Mon Dec 07, 2015 7:15 am

I was wanting to parse the Items, in addition to who bought what in the shop, from member rank, to ice, to spawners, to heads. All of that. In the end i was going to plug the numbers into a spreadsheet and analyze it.
Image
Image Im the engineer of engineers.
Check out my redstone info thread
User avatar
Pri
Site Admin
Site Admin
Posts: 5433
Joined: Fri Dec 14, 2007 8:59 am

Re: Shop Analyzing Help

Mon Dec 07, 2015 2:23 pm

I don't know if our shop as it is right now would work with the kind of parsing that Google offers. We don't have an API for the shop data either at this time but I may consider one if there is interest from the players for it.

If I was going to parse our page right now the way it is I'd probably use regex on specific class names and then store those, but this is me thinking about PHP, you can use regex with other languages though like Javascript.
User avatar
EmberCelica
Engineer
Engineer
CPU: i7 6700k
RAM: 16GB DDR4
Motherboard: [Unknown]
GPU: AMD RX480
Cooling: Fan Cooling
Location: Always behind you
Posts: 188
Joined: Sat Feb 28, 2015 11:20 pm

Re: Shop Analyzing Help

Mon Dec 07, 2015 3:56 pm

Alright i will see if javascript integration with google scripts is possible, thank you for letting me know pri, and please do let me know if an API comes out lol.
Image
Image Im the engineer of engineers.
Check out my redstone info thread
User avatar
EmberCelica
Engineer
Engineer
CPU: i7 6700k
RAM: 16GB DDR4
Motherboard: [Unknown]
GPU: AMD RX480
Cooling: Fan Cooling
Location: Always behind you
Posts: 188
Joined: Sat Feb 28, 2015 11:20 pm

Re: Shop Analyzing Help

Mon Dec 14, 2015 5:11 am

Forgot to post this, but thank you for the information and thank you jack, yet again, for giving me a few pointers, namely directing me towards python in this instance. The program is complete, and works, but could be improved upon, so until then i will not disclose code. I plan to modify it to write to a spreadsheet for easier reading since i have it writing to a log located in a psuedo-dynamic filepath, timestamped to the day.
Image
Image Im the engineer of engineers.
Check out my redstone info thread

Return to “Software Centre”

Who is online

Users browsing this forum: No registered users and 9 guests