koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
356 stars 67 forks source link

XML Data could not be parsed illegal character '<' #249

Closed codejoy closed 9 years ago

codejoy commented 9 years ago

Is there a parsing issue with some items in the steam condensor? I ran this code:

id = SteamId.new 'codejoy'
themgames = id.games
themgames.each do |key, array|
    puts "#{array.name} -----"
    puts array.user_stats(id.steam_id64).hours_played
end

and it gives me that illegal character '<' when i try to do the user stats stuff, unless I am totally using it wrong?

koraktor commented 9 years ago

Given that code your should get the name of the game that fails.

Additionally, you may also want to set $DEBUG = true.

codejoy commented 9 years ago

The name of the game that fails is "Age of Empires(R) III: Complete Collection"

The (R) is actual little registered trademark symbol. I wonder if that is what is doinking it up somehow. I am trying this in sinatra (used it as a learner project for both ruby and sinatra). So not sure how to set the equiv of $DEBUG = true (that looks more like php to me).

koraktor commented 9 years ago

I didn't have time to check this myself, yet.

Apparently there's something wrong inside the stats data for AoE.

$DEBUG is a global variable. You can set it to true at any point before calling Steam Condenser.

koraktor commented 9 years ago

Ok, I just had a look at the source data (http://steamcommunity.com/id/codejoy/stats/AgeofEmpiresIIICompleteCollection?xml=1).

Like I already expected, this is a problem on Steam's end (which happens quite regularly). It's probably best to rescue from such errors when iterating over multiple games' stats or profiles.

codejoy commented 9 years ago

Okay thanks for the feedback, I just will rescue from errors. Just was trying to tinker and write an app grabbing all the hours played from my games for fun. Strange their end is so wonky. Thanks though!