twitterv1

package
v0.0.0-...-f2a0a00 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddV1Path

func AddV1Path(function func(string, ...fiber.Handler) fiber.Router, url string, handler fiber.Handler)

func AttemptToAuthenticateWithOauth

func AttemptToAuthenticateWithOauth(c *fiber.Ctx) error

func CDNDownscaler

func CDNDownscaler(c *fiber.Ctx) error

func CDNVideoProxy

func CDNVideoProxy(c *fiber.Ctx) error

This is here because it doesn't just want a direct link to the m3u8 file. So we make an extremely basic site that just includes the video, and maybe the alt text if i care enough

func CheckTokenType

func CheckTokenType(token string) int

Checks the token is V1 Returns the token type 1 = V1 2 = V2 or unknown

func ConvertV1TokenToV2

func ConvertV1TokenToV2(token string) (*bridge.AuthToken, error)

This function converts the legacy V1 token format into a valid V2 token. This is used for backwards compatibility with the old V1 tokens.

func CreateShortLink(originalPath string, prefix string) (string, error)

func DeleteTweet

func DeleteTweet(c *fiber.Ctx) error

This handles deleting a tweet, retweet, or reply

func DevicePushDestinations

func DevicePushDestinations(c *fiber.Ctx) error

func EncodeAndSend

func EncodeAndSend(c *fiber.Ctx, data interface{}) error

func GenerateNumericPIN

func GenerateNumericPIN(length int) (string, error)

func GetAuthFromReq

func GetAuthFromReq(c *fiber.Ctx) (*string, *string, *string, *string, error)

GetAuthFromReq is a helper function to get the user DID and access token from the request. Also does some maintenance tasks like refreshing the access token if it has expired.

@return: userDID, pds, tokenUUID, accessJwt, error

func GetEncryptionKeyFromRequest

func GetEncryptionKeyFromRequest(c *fiber.Ctx) (*string, error)

func GetFollowers

func GetFollowers(c *fiber.Ctx) error

func GetFollowersIds

func GetFollowersIds(c *fiber.Ctx) error

func GetFollowingIds

func GetFollowingIds(c *fiber.Ctx) error

func GetFollows

func GetFollows(c *fiber.Ctx) error

func GetListMembers

func GetListMembers(c *fiber.Ctx) error

func GetLock

func GetLock(userDID string) *sync.Mutex

func GetMyActivity

func GetMyActivity(c *fiber.Ctx) error

/i/activity/about_me.json?contributor_details=1&include_entities=true&include_my_retweet=true&send_error_codes=true

func GetSettings

func GetSettings(c *fiber.Ctx) error

TODO

func GetStatusesFollowers

func GetStatusesFollowers(c *fiber.Ctx) error

https://web.archive.org/web/20101115102530/http://apiwiki.twitter.com/w/page/22554748/Twitter-REST-API-Method%3a-statuses%C2%A0followers At the moment we are not doing pagination, so this will only return the first ~50 followers.

func GetSuggestedUsers

func GetSuggestedUsers(c *fiber.Ctx) error

func GetUserInfoFromTweetData

func GetUserInfoFromTweetData(tweet blueskyapi.Post) bridge.TwitterUser

This is "depercated"/a togglable option in the config (eventually) Primarly used as a fallback if we cannot lookup user info

func GetUserSpecifiedInRequest

func GetUserSpecifiedInRequest(c *fiber.Ctx, no_value_default *string) (*string, error)

func HandleBlueskyError

func HandleBlueskyError(c *fiber.Ctx, responseJson string, lexicon string, function func(c *fiber.Ctx) error) error

func HandleFiletypeSplitter

func HandleFiletypeSplitter(handler fiber.Handler) fiber.Handler

func InitServer

func InitServer(config *config.Config)

func InternalSearch

func InternalSearch(c *fiber.Ctx) error

func MissingAuth

func MissingAuth(c *fiber.Ctx, err error) error

func MobileClientApiDecider

func MobileClientApiDecider(c *fiber.Ctx) error

misc

func OAuthAccessToken

func OAuthAccessToken(c *fiber.Ctx) error

func PrivacyPolicy

func PrivacyPolicy(c *fiber.Ctx) error
func RedirectToLink(c *fiber.Ctx) error

func RelatedResults

func RelatedResults(c *fiber.Ctx) error

Replies This is going to be painful to implement with lack of any docs

func RemovePush

func RemovePush(c *fiber.Ctx) error

this should probably use the udid

func RequestToken

func RequestToken(c *fiber.Ctx) error

func ReturnError

func ReturnError(c *fiber.Ctx, message string, error_code int, http_error int) error

WARNING! This doesn't return a non-nil value

func ReturnSuccessfulAuth

func ReturnSuccessfulAuth(c *fiber.Ctx, res blueskyapi.AuthResponse, pds string) error

func ServeOAuthLoginPage

func ServeOAuthLoginPage(c *fiber.Ctx) error

func TOS

func TOS(c *fiber.Ctx) error

func TranslatePostToTweet

func TranslatePostToTweet(tweet blueskyapi.Post, replyMsgBskyURI string, replyUserBskyId string, replyUserHandle string, replyTimeStamp *time.Time, postReason *blueskyapi.PostReason, token string, pds string) bridge.Tweet

This gigantic function is used to convert the bluesky post format, into a format that is compatible with the twitter API. https://web.archive.org/web/20120506182126/https://dev.twitter.com/docs/platform-objects/tweets

func TweetInfo

func TweetInfo(c *fiber.Ctx) error

This request is an "internal" request, and thus, these are very little to no docs. this is a problem. The most docs I could find: https://blog.fgribreau.com/2012/01/twitter-unofficial-api-getting-tweets.html

func UnfollowUserForm

func UnfollowUserForm(c *fiber.Ctx) error

func UnfollowUserParams

func UnfollowUserParams(c *fiber.Ctx) error

func UpdateProfile

func UpdateProfile(c *fiber.Ctx) error

func UpdateProfilePicture

func UpdateProfilePicture(c *fiber.Ctx) error

func UserProfileImage

func UserProfileImage(c *fiber.Ctx) error

func UserSearch

func UserSearch(c *fiber.Ctx) error

func VerifyCredentials

func VerifyCredentials(c *fiber.Ctx) error

func VerifyOAuthSignature

func VerifyOAuthSignature(params *OAuthParams, method, requestURL, consumerSecret string) bool

Types

type BlueskyError

type BlueskyError struct {
	Error   string
	Message string
}

type Error

type Error struct {
	Code    int    `json:"code" xml:"code,attr"`
	Message string `json:"message" xml:",chardata"`
}

type Errors

type Errors struct {
	XMLName xml.Name `json:"-" xml:"errors"`
	Error   []Error  `json:"errors"`
}

type OAuthParams

type OAuthParams struct {
	Callback        string
	ConsumerKey     string
	Nonce           string
	Signature       string
	SignatureMethod string
	Timestamp       string
	Version         string

	//used in final oauth thingy
	Verifier string
	Token    string
}

func ParseOAuthHeader

func ParseOAuthHeader(header string) (*OAuthParams, error)

type TempToken

type TempToken struct {
	Token     string
	Secret    string
	AuthResp  *blueskyapi.AuthResponse
	AuthPDS   *string
	Verifier  string
	CreatedAt time.Time
	ExpiresIn time.Duration
	Callback  string
}

type TokenLockManager

type TokenLockManager struct {
	// contains filtered or unexported fields
}

type TweetWithURI

type TweetWithURI struct {
	Tweet *bridge.Tweet
	URI   string
}

type TweetsRoot

type TweetsRoot struct {
	XMLName  xml.Name `xml:"statuses"`
	Statuses []bridge.Tweet
}

Jump to

Keyboard shortcuts

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