Core

package
v0.0.0-...-733246c Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client *http.Client = new(http.Client)
)

Functions

func FormatTweets

func FormatTweets(format string, tweets []Tweet)

func FormatTweetsCSV

func FormatTweetsCSV(tweets []Tweet)

func FormatTweetsJSON

func FormatTweetsJSON(tweets []Tweet)

func Main

func Main(Query *string, Instance *string, Format *string)

func Request

func Request(Query *string, Instance *string, cursor *string) io.ReadCloser

func Scrape

func Scrape(responseBody io.ReadCloser, Instance *string, Format *string, cursor *string) bool

Types

type Attachment

type Attachment struct {
	Type            string  `json:"type"`
	URL             *string `json:"url"`
	PreviewImageURL *string `json:"preview_image_url"`
	AltText         *string `json:"alt_text"`
}

type Tweet

type Tweet struct {
	ID          string       `json:"id"`
	URL         string       `json:"url"`
	Text        string       `json:"text"`
	ReplyTo     string       `json:"reply_to,omitempty"`
	Username    string       `json:"username"`
	Fullname    string       `json:"fullname"`
	Timestamp   string       `json:"timestamp"`
	Attachments []Attachment `json:"attachments"`

	Stats TweetStats `json:"stats"`

	QuoteFullname string `json:"quote_fullname,omitempty"`
	QuoteUsername string `json:"quote_username,omitempty"`
	QuoteDate     string `json:"quote_date,omitempty"`
	QuoteID       string `json:"quote_id,omitempty"`
	QuoteText     string `json:"quote_text,omitempty"`
}

type TweetStats

type TweetStats struct {
	Replies  int64 `json:"replies"`
	Retweets int64 `json:"retweets"`
	Quotes   int64 `json:"quotes"`
	Likes    int64 `json:"likes"`
}

Jump to

Keyboard shortcuts

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