Giter VIP home page Giter VIP logo

go-twitter's People

Contributors

arrow2nd avatar clashkid155 avatar g8rswimmer avatar gabek avatar gdsoumya avatar jlortiz0 avatar masatoraatarashi avatar touyu avatar ykarulin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-twitter's Issues

404 should report relevant information back to caller

When I call

lookups, err := tweet.FilteredStream(context.Background(), fieldOpts)

In tweet.go the call:

err := decoder.Decode(e);

returns invalid character '<' looking for beginning of value

This is then passed up to the caller of .FilteredStream, with the error being tweet lookup response error decode: invalid character '<' looking for beginning of value

This isn't a very meaningful error, I think it should be relayed to the user that a 404 has occurred.

Information:
req: GET https://api.twitter.com//2/tweets/search/stream
resp.Status: 404 Not Found

v2: Blocking Users API

Blocking users is a core security feature on Twitter. Using the endpoints in the manage blocks endpoint group, you can build safer experiences for Twitter users or block users programmatically based on previous engagements. You can also unblock users after a given period of time, based on the criteria that you determine. Using blocks lookup, you can see who you or an authenticated user has blocked. This can be useful for determining how you can interact with a given account.

https://developer.twitter.com/en/docs/twitter-api/users/blocks/introduction

Rate limit handling

Is there already an implementation for handling rate limits (v2)?
I'm thinking of using the x-rate-limit-reset HTTP header to trigger an automatic waiting period, similar to what tweepy does.
Unfortunately, at least for UserLookupResponse there is no meta object yet.

Premium search API implementation

Is there any plans of implementing premium search twitter APIs, I know they are currently only based on v1.1 but I do not see their implementation in V1 package of go-twitter library as well?

Drop me a line?

Hi Sean - can you follow or DM me on Twitter? apologies for the weird GH issue reach out :-)

v2 RecentSearchV2 response error

maybe happend at:

resp, err := client.TweetRecentSearch(context.Background(), query, opts)
	if err != nil {
		log.Fatal(err)
		return nil, err
	}

logs:

twiiter callout status 429 UsageCapExceeded:Usage cap exceeded: Monthly product cap

Like and retweet updates

Today, we are launching improvements to the Retweets lookup endpoint and the Likes lookup endpoint which show you which accounts have liked or retweeted a Tweet. Now, you will be able to retrieve the full list of accounts that have Liked or Retweeted a Tweet.

Previously, you were limited to the 100 most recent Likes or Retweets with these endpoints. We heard your feedback that this was too limiting and have updated these endpoints to now return all results.
To retrieve a complete list of Likes and Retweets, you can now use pagination. In addition, you can authenticate these endpoints with either OAuth 1.0a User Context, OAuth 2.0 Authorization Code Flow with PKCE, or OAuth 2.0 Bearer Token.

We’re continuing to add new features and functionality to Twitter API v2. Be sure to keep an eye on our public roadmap for the latest. As always, we’d love to hear what you think. Please reach out with any questions or feedback on what you’d like to see in the future.

Steaming Api's returing maps

Hi, I was wondering why Functions like FilteredStream,

func (t *Tweet) FilteredStream(ctx context.Context, options TweetFieldOptions) (TweetLookups, error) {

or SampledStream
func (t *Tweet) SampledStream(ctx context.Context, options TweetFieldOptions) (TweetLookups, error) {
are returning maps instead of channels?

Is it possible to change it so that it start's returning a channel and function, maybe a Stop function, when called we could close the channel?

Any other suggestions?

v2: Setup current repo for version 2 of the library

Unfortunately, v2 of the library is needed to address some short comings of the fist version. This is the kick off to try and make sure that this new version provides better functionality to the users.

Needs

  • Step v2 directory - keep the old version to allow for users to be able to use version one as long as possible and make updates until v2 is mature enough and feature set is better than v1
  • Step up notification of v2 project and what will be done. This is to allow users to keep progress of v2 beta releases. Also to encourage comments on the direction of the library so that it can meet the needs of the current and future users.
  • Start the documentation of v2 on the main page, but keep the old readme available by reference.

upgrade to mod

Add Go mod to the project and update outdated libraries like ioutil.

v2 TweetRecentSearch: got result some text truncation.

in v2 TweetRecentSearch: got result some text incomplete display.

{
    "Raw": {
        "data": [{
            "id": "1496269047071223810",
            "text": "RT @Arad064083512: @OfficialTravlad @TheRealM0nk @TheWolfyofBSC @SpyWolfNetwork The strongest predators of nature are wolves. This is becau…",
            "author_id": "1387190115202707461",
            "conversation_id": "1496269047071223810",
            "created_at": "2022-02-22T23:41:54.000Z",
            "lang": "en"
        }, {
            "id": "1496269031975890944",
            "text": "RT @KKi09918980: @OfficialTravlad @TheRealM0nk @TheWolfyofBSC @SpyWolfNetwork Security is the most valuable asset that is not easily obtain…",
            "author_id": "1387190115202707461",
            "conversation_id": "1496269031975890944",
            "created_at": "2022-02-22T23:41:51.000Z",
            "lang": "en"
        }, {
            "id": "1496269025537675264",
            "text": "@HustlersWallSt 🔥💰 #wallstreet #Ethereum #BTC 📈📈📈📈📈📈 https://t.co/abZAF9NwOV",
            "author_id": "235851878",
            "conversation_id": "1496269025537675264",
            "created_at": "2022-02-22T23:41:49.000Z",
            "lang": "und"
        }]}}

i set options

opts := twitter.TweetRecentSearchOpts{
		Expansions: []twitter.Expansion{twitter.ExpansionEntitiesMentionsUserName, twitter.ExpansionAuthorID},
		TweetFields: []twitter.TweetField{twitter.TweetFieldText, twitter.TweetFieldCreatedAt,
			twitter.TweetFieldConversationID, twitter.TweetFieldLanguage, twitter.TweetFieldEntities, twitter.TweetFieldContextAnnotations},
		// twitter.TweetFieldNonPublicMetrics, twitter.TweetFieldOrganicMetrics, twitter.TweetFieldPromotedMetrics, twitter.TweetFieldPublicMetrics,
		MaxResults: 100,
		NextToken:  nextToken,
		// UserFields:  []twitter.UserField{twitter.UserFieldName, twitter.UserFieldID, twitter.UserFieldUserName},
	}

v2: Muting Users API

Muting an account allows you to remove an account's Tweets from your timeline without unfollowing or blocking that account. Muted accounts will not know that you've muted them and you can unmute them at any time. With manage mutes endpoints, developers can create safer experiences for people on Twitter. One example of how to build with manage mutes is an application that allows you to mute accounts that might Tweet about specific topics for a specified length of time. With the mutes lookup endpoint, you can see who you or an authenticated user has muted. This can be useful to determine how you interact with the muted accounts.

https://developer.twitter.com/en/docs/twitter-api/users/mutes/introduction

Using library with OAuth 1.0 user context authorization

It's been a pleasure using library with oauth 2.0 bearer token authorization. Great job!

Now I'm trying to get responses with oauth1.0 for api v2 as described here

https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets

As I understand I just need to write new authorize struct, that will use oauth1.0

type authorize struct {
Token string
}
func ( a authorize ) Add( req *http.Request ) {
req.Header.Add( "Authorization", fmt.Sprintf( "Bearer %s", a.Token ) )
}

Found several oauth1.0 implementation like this

github.com/dghubble/oauth1

They all seem to provide authorization logic through http.Client

So I've tried to use client from this lib but it didn't work

twAppConfig := oauth1.NewConfig(CONSUMER_KEY, CONSUMER_SECRET)
token := oauth1.NewToken(TOKEN, TOKEN_SECRET)
httpClient := twAppConfig.Client(oauth1.NoContext, token)

tweet := &twitter.Tweet{
Authorizer: authorize{},
Client: httpClient,
Host: "https://api.twitter.com",
}

Writing custom oauth implementation for this case doesn't seem right, so I believe there is a way to use the existing solutions, that I just don't see

Please help :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.