tweetinvi | intuitive Twitter C # library for the REST and Stream API | REST library
kandi X-RAY | tweetinvi Summary
kandi X-RAY | tweetinvi Summary
Tweetinvi is an intuitive .NET C# library to access the Twitter REST API. It is a .NETCore and Portable Class Library that can be used for development on Windows, Windows RT, Windows Phone, Mono, Xamarin Android and Xamarin iOS. Tweetinvi is also compatible for Universal App development. Tweetinvi is developed for free. All donations are greatly appreciated.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tweetinvi
tweetinvi Key Features
tweetinvi Examples and Code Snippets
Community Discussions
Trending Discussions on tweetinvi
QUESTION
I'm reading tweets using the following code, it works fine but the media object is always empty even if the tweet has a picture but it works fine if the tweet has a video instead of picture!
...ANSWER
Answered 2021-May-22 at 00:02The Media
member of ITweet
is a List
. It's possible for this list to be empty. Using the below code, I was able to receive tweets with their Media
member containing IMediaEntity
objects:
QUESTION
I am trying to improve the speed of a tweet handler, currently using a tweetInvi FilteredStream, but it takes upwards of 8 seconds from a tweet being posted to it being received as an event on my end (till HandleTweet() gets called).
...ANSWER
Answered 2021-May-18 at 10:20Tweetinvi opens a socket with the Twitter Stream Endpoint. It means that any delay (apart from network latency) will come from when Twitter manages to analyse the event and send it back to its streams.
QUESTION
I'm a beginner using async in VB.NET. I read online help but some things aren't clear. I try to use tweetinvi library
I got this:
...ANSWER
Answered 2021-Feb-02 at 09:11You can see it in the code you posted. The second line of that method does it. You use the Await
operator to await the completion of the Task
.
That said, there is no result to get anyway. If you have a synchronous Sub
then that becomes an asynchronous Function
that returns a Task
. In both cases, there is no actual value to get out of the method. As such, awaiting such a method doesn't return anything. If you have a synchronous Function
with a return type of T
then that becomes an asynchronous Function
that returns a Task(Of T)
. Awaiting that gives you a result of type T
.
If you had these methods:
QUESTION
I watched a video on Youtube. I uploaded Tweetinvi. I wrote the same code in the video, but there was an error. I don't know what i did wrong. Error: The name 'Auth' does not exist in the current context
...ANSWER
Answered 2020-Nov-24 at 06:51Auth for older versions. Check Tweetinvi 5.0.3 documentation out https://linvi.github.io/tweetinvi/dist/twitter-api-v1.1/tweets.html
QUESTION
My plan:
I am writing a bot, that will send some tweets every now and then using the library tweetinvi (https://github.com/linvi/tweetinvi).
The bot is currently using the access token and secret I generated in my developer console.
The issue:
The bot will send the tweets using my personal account now. That's why I created a new secondary account, that should be used for the tweets in the future.
But how can I authenticate the bot now?
The new account is not a developer account and I don't see any option to generate an access token and secret in the account settings.
Further more I don't think the usual oauth "click on the twitter icon and login to twitter" sign in is the right choice for my bot, because I don't have a website or browser session, just a program that runs wherever.
Can't I just create a some static sort of access token and a secret for my secondary account?
What would you suggest me to do, if that is not possible?
...ANSWER
Answered 2020-Oct-04 at 13:37Yes, you can create an access token and secret for your secondary account. The standard way to do this would be to implement sign-in with Twitter in an app, which would require a web backend.
There are a couple of alternative options:
- You can use
twurl
, which is a Twitter-provided command line tool. You’ll need to have Ruby installed, and then installtwurl
. Usingtwurl
you can run
twurl authorize --consumer-key [your API token] --consumer-secret [your API secret]
This will then provide a URL you should open in your browser. Authenticate this to your secondary account and type the PIN into your terminal. The account token and secret will be placed in a hidden file called .twurlrc
in your home directory, and you can use them for your bot in the same way you’re currently using your main account tokens.
- You can use another utility called tw-oob-oauth-cli to do the same thing. This is a bit easier as you don’t need to install Ruby, and can just download a Windows binary. You’ll want to rename the binary with a .exe extension.
tw-oob-oauth.exe --key [your API token] --secret [your API secret]
This will output the account token and secret on the terminal after you’ve been through the web flow.
QUESTION
Im using Tweetinvi 4.0.3 and .NET 4.7.2. I made a new project and I'm just testing to try and get Twitter working with my desktop application. I'm using the example from the wiki for Tweetinvi but it throws a exception:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Because authenticationContext
is returning null from AuthFlow.InitAuthentication(appCredentials);
Here is my code:
...ANSWER
Answered 2020-Aug-27 at 14:57After a large amount of time spent I was able to figure out the issue. I guess Twitter is now requiring TLS 1.2 as stated here: https://api.twitterstat.us/ (scroll down to update on 25/7/2019). Upgrading my .NET Framewokr to 4.6 (from 4.0) resolves the issue.
I read somewhere else you can use System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
. Source
Hope this helps someone else in the future.
QUESTION
I'm in the process of building a new Discord bot (of course), and I've been working on the Twitter integration using Tweetinvi. I've got most of the Twitter streaming bits working normally (at least, as far as I can tell in my simplified testing), but I wanted to have the bot modify/delete posts in Discord if the Tweet is subsequently deleted. Tweetinvi has a TweetDeleted
event that I can use to detect this as a part of my stream, but I'm having difficulty figuring out how to find the post in Discord.
What I'd like to do is "simply":
- Search for posts (embeds) from the author (defined by the original Tweet)
- Find the post with a matching
.Url
value in the embed - Replace that post with a message like "
THIS TWEET WAS DELETED
".
The problem I'm running into, however, is I can't seem to find a way to do "step 1" - search for and return any posts from the specified author. The only option I've found so far is the GetMessagesAsync
method, but that doesn't seem to have a way to filter the results. Plus, with the "soft limit" of 100 messages, I worry that I could still not find the message I'm looking to delete.
I post the embeds using the DiscordSocketClient
object in my class like this:
ANSWER
Answered 2020-Aug-16 at 14:06- Discord does not provide an endpoints for Bots to search/filter on specific criteria. The only way to retrieve messages is to use the
GetMessagesAsync()
method - The limit for
GetMessagesAsync()
is technicallyInt32.MaxValue
. The 100 that you see is simply the default. This is because Discord will return in chunks; 100 messages at a time. For example if you set the limit to 1000, you will get 10 chunks of 100. - Possible issues with retrieving a large number of messages? The main issue would be the length of time taken to retrieve the messages, which could block the gateway unless offload the process to its own task.
A possible solution would be to implement your own system for linking and storing twitter posts to discord posts. Could be as simple as a dictionary of Twitter post id and discord post id which would allow you to easily find the message id related to a given twitter post.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tweetinvi
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page