MetricsGrimoire / Sibyl

Sibyl analyzes Question & Answer websites (similar to askbot based ones)
5 stars 3 forks source link

Error parsing wrong URL for user data #4

Closed canasdiaz closed 10 years ago

canasdiaz commented 10 years ago
https://ask.puppetlabs.com/api/v1/users/698/
https://ask.puppetlabs.com/api/v1/users/ffrank/
Traceback (most recent call last):
  File "sibyl.py", line 132, in <module>
    askbot_parser(session, opts.url)
  File "sibyl.py", line 110, in askbot_parser
    user = askbot.get_user(user_id)
  File "/home/luis/repos/Sibyl/pysibyl/askbot.py", line 191, in get_user
    parser.parse()
  File "/home/luis/repos/Sibyl/pysibyl/utils.py", line 129, in parse
    raise JSONParserError(error=repr(e))
pysibyl.utils.JSONParserError: error parsing JSON. ValueError('No JSON object could be decoded',)
canasdiaz commented 10 years ago

The error is related to the HTML parsing

canasdiaz commented 10 years ago

It is needed to improve the logic of the HTML parsing.

For example in "user_identifier = href.split('/')[3]" we get the third field instead of using a regular expression. We needed that to support the PuppetLabs askbot instance.