by Psyker7 » Mon Feb 16, 2009 11:48 pm
I'm currently in the process of hacking together some pieces to get this working as a single vbscript.
Problem I'm coming up against at the moment is when accessing last.fm's 2.0 xml feeds.
The error I get is "System does not support the specified encoding"
Not quite sure how to get around this - if I save the xml page locally, it works fine.
Code snippet:
Code: Select all
xmlURL = "http://ws.audioscrobbler.com/2.0/?method=user.getWeeklyChartList&user=" & fixurl(user) & "&api_key=daadfc9c6e9b2c549527ccef4af19adb"
Set xmlDoc = CreateObject("MSXML2.DOMDocument.3.0")
xmlDoc.async = False
xmlDoc.Load (xmlURL) ' <<<<---- load last.fm xml occurs here
If (xmlDoc.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
MsgBox("You have error " & myErr.reason)
Else
'Do more stuff here
End If
The error is triggered, when I don't understand why.
Example xml page:
http://ws.audioscrobbler.com/2.0/?metho ... ef4af19adb
which appears fine to me :|
Any hints appreciated!
edit: thought i'd add - using the 2.0 api as apparently the 1.0 api no longer lists playcounts O,o
edit #2: found some info here: http://support.microsoft.com/kb/304625 but not quite sure how to implement this - bit beyond my knowledge of msxml
edit #3: (going overboard on edits... meh) - What is strange is the 1.0 API does work to parse the XML at least, it just doesn't have the data I need - eg: http://ws.audioscrobbler.com/1.0/user/p ... kchart.xml
I'm currently in the process of hacking together some pieces to get this working as a single vbscript.
Problem I'm coming up against at the moment is when accessing last.fm's 2.0 xml feeds.
The error I get is "System does not support the specified encoding"
Not quite sure how to get around this - if I save the xml page locally, it works fine.
Code snippet:[code]
xmlURL = "http://ws.audioscrobbler.com/2.0/?method=user.getWeeklyChartList&user=" & fixurl(user) & "&api_key=daadfc9c6e9b2c549527ccef4af19adb"
Set xmlDoc = CreateObject("MSXML2.DOMDocument.3.0")
xmlDoc.async = False
xmlDoc.Load (xmlURL) ' <<<<---- load last.fm xml occurs here
If (xmlDoc.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
MsgBox("You have error " & myErr.reason)
Else
'Do more stuff here
End If[/code]
The error is triggered, when I don't understand why.
Example xml page:
http://ws.audioscrobbler.com/2.0/?method=user.getWeeklyChartList&user=psykar&api_key=daadfc9c6e9b2c549527ccef4af19adb
which appears fine to me :|
Any hints appreciated!
[size=85]edit: thought i'd add - using the 2.0 api as apparently the 1.0 api no longer lists playcounts O,o
edit #2: found some info here: http://support.microsoft.com/kb/304625 but not quite sure how to implement this - bit beyond my knowledge of msxml
edit #3: (going overboard on edits... meh) - What is strange is the 1.0 API does work to parse the XML at least, it just doesn't have the data I need - eg: http://ws.audioscrobbler.com/1.0/user/psykar/weeklytrackchart.xml[/size]