newshound

package module
v0.0.0-...-90bc1be Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 6 Imported by: 0

README

Newshound: The Breaking News Email Aggregator

GoDoc Build Status

Newshound is a tool to analyze, visualize and share breaking news email alerts.

This repository contains a service to pull and parse breaking news alerts from an email inbox and a fast noun-phrase extracting 'microservice' to extract important phrases and help detect any News Events that may have occurred. That News Event data is then used to generate historic reports for each news source.

To emit alert notifications to Slack or Twitter, fetchd can pass information to barkd via Google Cloud Pub/Sub.

There is also a web server and an API for displaying and sharing Newshound information.

Documentation

Index

Constants

View Source
const (
	WebDir = "/opt/newshound/www"

	NewsAlertTopic       = "news-alerts"
	NewsEventTopic       = "news-events"
	NewsEventUpdateTopic = "news-event-updates"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBURL      string `json:"db-url"`
	DBUser     string `json:"db-user"`
	DBPassword string `json:"db-pw"`

	MarkRead          bool `json:"mark_as_read"`
	eazye.MailboxInfo `,inline`

	BarkdChannel string `json:"barkd-channel"`

	SlackAlerts []struct {
		Key string `json:"key"`
		Bot string `json:"bot"`
	} `json:"slack-alerts"`

	SlackEvents []struct {
		Key string `json:"key"`
		Bot string `json:"bot"`
	} `json:"slack-events"`

	Twitter []struct {
		ConsumerKey       string `json:"consumer-key"`
		ConsumerSecret    string `json:"consumer-secret"`
		AccessToken       string `json:"access-token"`
		AccessTokenSecret string `json:"access-token-secret"`
	} `json:"twitter"`

	WSPort int `json:"ws-port"`
}

func NewConfig

func NewConfig() *Config

func (*Config) MgoSession

func (c *Config) MgoSession() (*mgo.Session, error)

type NewsAlert

type NewsAlert struct {
	NewsAlertLite `,inline`
	RawBody       string     `json:"-"bson:"raw_body"`
	Body          string     `json:"body"bson:"body"`
	Sentences     []Sentence `json:"sentences"bson:"sentences"`
}

NewsAlertFull is a struct that contains all News Alert data. This struct is used for access to a single Alert's information.

type NewsAlertLite

type NewsAlertLite struct {
	ID          bson.ObjectId `json:"id" bson:"_id"`
	InstanceID  string        `json:"instance_id"bson:"instance_id"`
	ArticleUrl  string        `json:"article_url"bson:"article_url"`
	Sender      string        `json:"sender"bson:"sender"`
	Timestamp   time.Time     `json:"timestamp"bson:"timestamp"`
	Tags        []string      `json:"tags"bson:"tags"`
	Subject     string        `json:"subject"bson:"subject"`
	TopSentence string        `json:"top_sentence"bson:"top_sentence"`
}

NewsAlertLite is a struct that contains partial News Alert data. This struct lacks a Body and Raw Body to reduce the size when pulling large lists of Alerts. Mainly used for 'findByDate' scenarios.

type NewsEvent

type NewsEvent struct {
	ID          bson.ObjectId    `json:"id" bson:"_id"`
	Tags        []string         `json:"tags"`
	EventStart  time.Time        `json:"event_start"bson:"event_start"`
	EventEnd    time.Time        `json:"event_end"bson:"event_end"`
	NewsAlerts  []NewsEventAlert `json:"news_alerts"bson:"news_alerts"`
	TopSentence string           `json:"top_sentence"bson:"top_sentence"`
	TopSender   string           `json:"top_sender"bson:"top_sender"`
}

NewsEvent is a struct that contains all the information for a particular News Event.

type NewsEventAlert

type NewsEventAlert struct {
	AlertID     bson.ObjectId `json:"alert_id"bson:"alert_id"`
	InstanceID  string        `json:"instance_id"bson:"instance_id"`
	ArticleUrl  string        `json:"article_url"bson:"article_url"`
	Sender      string        `json:"sender"bson:"sender"`
	Tags        []string      `json:"tags"bson:"tags"`
	Subject     string        `json:"subject"bson:"subject"`
	TopSentence string        `json:"top_sentence"bson:"top_sentence"`
	Order       int64         `json:"order"bson:"order"`
	TimeLapsed  int64         `json:"time_lapsed"bson:"time_lapsed"`
}

NewsEventAlert is a struct for holding a smaller version of News Alert data. This struct has extra fields for determining the order and time differences of the News Alerts within the News Event.

type Sentence

type Sentence struct {
	Value   string   `json:"sentence"bson:"sentence"`
	Phrases []string `json:"noun_phrases"bson:"noun_phrases"`
}

Directories

Path Synopsis
api
api package contains the Newshound API.
api package contains the Newshound API.

Jump to

Keyboard shortcuts

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