gdelt

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: BSD-2-Clause Imports: 12 Imported by: 0

README

GDELT

A simple tool to get the latest events from http://data.gdeltproject.org/gdeltv2/lastupdate.txt

Usage

Requirements:

Clone this repo or get the library:

go get -u github.com/SpecializedGeneralist/gdelt

Example

package main

import (
	"fmt"
	"github.com/SpecializedGeneralist/gdelt"
)

func main()  {
	fmt.Println("Getting latest events from GDELT...")
	events, err := gdelt.GetLatestEvents()
	if err != nil {
		panic(err)
	}
	fmt.Printf("Found %d new events.\n", len(events))
	for _, e := range events {
		fmt.Println(e.SourceURL)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLatestEvents

func GetLatestEvents() ([]*events.Event, error)

Types

type DataExportCSVZipReference

type DataExportCSVZipReference struct {
	Size   int
	MD5Sum string
	URL    string
}

DataExportCSVZipReference is a reference to GDELT Export CSV Zip-compressed file.

func FetchDataExportCSVZipReference

func FetchDataExportCSVZipReference(CSVDataFileListURL string) (*DataExportCSVZipReference, error)

FetchDataExportCSVZipReference fetches a reference to GDELT Export CSV Zip-compressed file from the given file list URL.

func (*DataExportCSVZipReference) GetLatestEvents

func (d *DataExportCSVZipReference) GetLatestEvents() ([]*events.Event, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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