twitter

package
v0.0.0-...-ad4c16b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrawlAuthorTweets

func CrawlAuthorTweets(author model.TweetAuthor, notifyDone chan<- error)

CrawlAuthorTweets traverses the author's timeline(s) and populates the DB with the proper tweets

func CreateClient

func CreateClient(tokenStr string) *twitter.Client

CreateClient creates a reusable Twitter client using the given token

func GetClient

func GetClient() *twitter.Client

GetClient returns a reusable Twitter client, if initialized

func GetUser

func GetUser(screenName string) (user *twitter.User, err error)

GetUser gets a user from Twitter for a certain screen name Results are cached for a minute

Types

type ApplyOffsetHandler

type ApplyOffsetHandler struct{}

ApplyOffsetHandler is a handler that receives two tweets and replaces the first one with newest one after applying an offset to the second one.

func (ApplyOffsetHandler) ServeHTTP

func (h ApplyOffsetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GetSingleTweetHandler

type GetSingleTweetHandler struct{}

GetSingleTweetHandler is a handler for retrieving details about a single tweet

func (GetSingleTweetHandler) ServeHTTP

type LatestTweetsHandler

type LatestTweetsHandler struct{}

LatestTweetsHandler is a handler for getting the IDs of the latest presidential tweets

func (LatestTweetsHandler) ServeHTTP

func (h LatestTweetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NewerTweetsHandler

type NewerTweetsHandler struct{}

NewerTweetsHandler is a handler that receives two tweets and replaces the older one with the next newest one by the same author.

func (NewerTweetsHandler) ServeHTTP

func (h NewerTweetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OlderTweetsHandler

type OlderTweetsHandler struct{}

OlderTweetsHandler is a handler that receives two tweets and replaces the newer one with the next older one by the same author.

func (OlderTweetsHandler) ServeHTTP

func (h OlderTweetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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