Code Monkey home page Code Monkey logo

Comments (4)

tscritch avatar tscritch commented on September 26, 2024 1

Hey @shanness,
I'm currently refactoring this section of the code. I'll take a look at this as well.
Thanks!

from slack-export-viewer.

shanness avatar shanness commented on September 26, 2024

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"
    }
]

from slack-export-viewer.

shanness avatar shanness commented on September 26, 2024

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!

from slack-export-viewer.

hfaran avatar hfaran commented on September 26, 2024

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.

from slack-export-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.