Closed shanness closed 6 years ago
I changed the code in compile_channels to catch the error
day_messages = json.load(f)
except ValueError as v:
print "Error ",v," with data ",f
Error Extra data: line 33 column 2 - line 60 column 2 (char 1257 - 1952) with data <_io.TextIOWrapper name=u'/tmp/_slackviewer/fabe5eeee0ff9d65446eece86d25dec91615210f/team-site/2017-01-10.json' encoding='utf8'>
Error Extra data: line 33 column 2 - line 60 column 2 (char 1257 - 1952) with data <_io.TextIOWrapper name=u'/tmp/_slackviewer/fabe5eeee0ff9d65446eece86d25dec91615210f/team-site/2017-01-10.json' encoding='utf8'>
And found that json file has two arrays in it. My except block allows me to now load the export.
[
{
"user": "U06TFPM3K",
"text": "<@U06TFPM3K> has joined the channel",
"type": "message",
"subtype": "channel_join",
"ts": "1484049182.000002"
},
{
"user": "U193Y8EH1",
"inviter": "U06TFPM3K",
"text": "<@U193Y8EH1> has joined the channel",
"type": "message",
"subtype": "channel_join",
"ts": "1484049182.000003"
},
{
"user": "U3PGV4H3N",
"inviter": "U06TFPM3K",
"text": "<@U3PGV4H3N> has joined the channel",
"type": "message",
"subtype": "channel_join",
"ts": "1484049183.000004"
},
{
"user": "U06TFPM3K",
"topic": "Pingpad can help you capture shared knowledge, organize and act on it. I will save Posts and Pinned messages as wiki pages automatically for you to <https:\/\/pingpad.io>. Say `help` to get started.",
"text": "<@U06TFPM3K> set the channel topic: Pingpad can help you capture shared knowledge, organize and act on it. I will save Posts and Pinned messages as wiki pages automatically for you to <https:\/\/pingpad.io>. Say `help` to get
started.",
"type": "message",
"subtype": "channel_topic",
"ts": "1484049183.000005"
}
][
{
"user": "U06TFPM3K",
"text": "<@U06TFPM3K> has joined the channel",
"type": "message",
"subtype": "channel_join",
"ts": "1484049182.000002"
},
{
"user": "U193Y8EH1",
"inviter": "U06TFPM3K",
"text": "<@U193Y8EH1> has joined the channel",
"type": "message",
"subtype": "channel_join",
"ts": "1484049182.000003"
},
{
"user": "U06TFPM3K",
"members": [
"U06TFPM3K",
"U193Y8EH1"
],
"text": "<@U06TFPM3K> archived the channel",
"type": "message",
"subtype": "channel_archive",
"ts": "1484049183.000004"
}
]
Hey @shanness, I'm currently refactoring this section of the code. I'll take a look at this as well. Thanks!
Ta. Worked perfectly! I hacked to to filter only messages with a certain annotation, and only include channels with filtered messages, which was perfect for some reporting we had to do. Thanks for the great codebase, easy to work with!
This looks like the same bug that I fixed in #63. @shanness please try the new release 0.6.0 and see if it works.
ValueError: Extra data: line 33 column 2 - line 60 column 2 (char 1257 - 1952)