tweet

package
v0.0.0-...-a9933ba Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LegacyUsersTweetsEndpoint = "https://api.twitter.com/1.1/timeline/user.json"

Variables

View Source
var OAuthConfig = oauth1.Config{
	ConsumerKey:    "3nVuSoBZnx6U4vzUxf5w",
	ConsumerSecret: "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys",
}

Functions

func FindInitialUsers

func FindInitialUsers(ctx context.Context) error

func GetRandomAccount

func GetRandomAccount() *database.OpenAccountModel

func GetTweetsByUserActivity

func GetTweetsByUserActivity(ctx context.Context, userId string) error

func ScrapeTweetsByUsersWorkflow

func ScrapeTweetsByUsersWorkflow(ctx workflow.Context) error

func StartUserTweetsScraper

func StartUserTweetsScraper()

func StartUserTweetsWorker

func StartUserTweetsWorker()

Types

type RawResponse

type RawResponse struct {
	TwitterObjects struct {
		Tweets map[string]RawTweet `json:"tweets"`
	} `json:"twitter_objects"`
}

type RawResponseSearch

type RawResponseSearch struct {
	Metadata struct {
		Cursor               string `json:"cursor"`
		RefreshIntervalInSec int    `json:"refresh_interval_in_sec"`
	} `json:"metadata"`
	Modules []struct {
		Status struct {
			Data struct {
				CreatedAt     string `json:"created_at"`
				IDStr         string `json:"id_str"`
				FullText      string `json:"full_text"`
				RetweetCount  int    `json:"retweet_count"`
				FavoriteCount int    `json:"favorite_count"`
				User          struct {
					IDStr string `json:"id_str"`
				} `json:"user"`
				Lang string `json:"lang"`
			} `json:"data"`
		} `json:"status"`
	} `json:"modules"`
}

type RawTweet

type RawTweet struct {
	CreatedAt string `json:"created_at"`
	ID        int64  `json:"id"`
	IDStr     string `json:"id_str"`
	FullText  string `json:"full_text"`
	User      struct {
		ID                 int    `json:"id"`
		IDStr              string `json:"id_str"`
		HasNoScreenName    bool   `json:"has_no_screen_name"`
		RequireSomeConsent bool   `json:"require_some_consent"`
	} `json:"user"`
	RetweetCount  int    `json:"retweet_count"`
	FavoriteCount int    `json:"favorite_count"`
	Lang          string `json:"lang"`
}

Jump to

Keyboard shortcuts

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