parser

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package parser parses snapchat chat history from a json file to a struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAll

func ParseAll(r io.Reader) (data map[string][]*Content, err error)

ParseAll parses the chat history. It returns a map of usernames, a Content slice, and any error encountered.

Types

type Content

type Content struct {
	From               string
	MediaType          string `json:"Media Type"`
	Created            string
	Content            string `json:",omitempty"`
	ConversationTitle  string `json:"Conversation Title"`
	IsSender           bool   `json:"isSender"`
	CreatedMicrosecond int64  `json:"Created(microseconds)"`
}

Content contains the fields in the chat history json file

func ParseUser

func ParseUser(r io.Reader, user string) (content []*Content, err error)

ParseUser parses the chat history with one user. It returns a Content slice, and any encountered error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL