WinformExampleWithTweetinvi

Feb 28, 2014 at 8:23 AM
I have downloaded this project http://download-codeplex.sec.s-msft.com/Download?ProjectName=tweetinvi&DownloadId=779008 and this work well

i download from here https://tweetinvi.codeplex.com/discussions/461350
Image

yesterday I did reinstall my windows and when I run the application and click the "Start Stream", suddenly appeared a request for StreamResultGenerator.cs as shown below
Image

the question is:
  1. where can I get StreamResultGenerator.cs? because I can not find it in this project
  2. when I select cancel, it happened like this
    Image
    how to solve these problems?
  3. can you give some example for windows form application actually using FilteredStream? I really appreciate it
sorry for my english :)
Coordinator
Feb 28, 2014 at 8:58 AM
Hi,

First the 401 exception is probably the result of you not providing the right credentials. Are you sure the credentials you are providing to the application are correct?

Where can I get StreamResultGenerator.cs? because I can not find it in this project

If you download the currently latest version 34894 of Tweetinvi Source Code you can get the file here:
Release/Streaminvi/Helpers/StreamResultGenerator.cs

When I select cancel, it happened like this, how to solve these problems?

As I said the problem probably comes from the fact that your credentials are invalid.

Can you give some example for windows form application actually using FilteredStream? I really appreciate it

I can do that but it will use the latest version of Tweetinvi 0.9 instead of 0.8.3.23.
I would develop this example for you tonight or tomorrow if this is alright with you?

Linvi
Feb 28, 2014 at 9:41 AM
Edited Feb 28, 2014 at 9:48 AM
Thanks for the fast reply

for 401 exception, I guess I have to enter the correct credential because before I reinstall my windows this project is work very well
but after the reinstall my windows, suddenly appeared 401 exception

sure its ok if use the latest version of Tweetinvi 0.9
I can certainly wait, thank you for helping me :)
Coordinator
Feb 28, 2014 at 5:27 PM
Hi,

You can find the project here (Tweetinvi 0.9 - FilteredStream - Winforms).

Regards,
Linvi
Mar 3, 2014 at 10:56 AM
thanks for the reply
i have some problem when i run this project
when i click "Start Stream", tweet does not appear in the textbox like this
Image

and there are no errors occurred
Coordinator
Mar 3, 2014 at 11:02 AM
Hi,

Have you updated any code?
Did you set the credentials correctly?

Linvi
Mar 3, 2014 at 11:10 AM
i just set the credential
yes i did, i set the credential Correctly and when i click on "Who am I?" My twitter name appears
I do not know what's wrong
Coordinator
Mar 3, 2014 at 11:32 AM
Hi,

This is working perfectly fine for me.
Would please send me your credentials privately (contact page), I will attempt to use them and see if anything is going wrong.
I will use them only in the context of helping you solve this issue.

Linvi
Mar 3, 2014 at 11:38 AM
I've sent the credential
Coordinator
Mar 3, 2014 at 12:06 PM
Thanks,

Your credentials are working fine for me, I receive the tweets. I will investigate and let you know later in the day.
In the meantime please verify your ErrorHandler.GetLastException to verify whether you have an exception occurring or not.

Linvi
Coordinator
Mar 9, 2014 at 3:17 PM
Hi,

I think I know what is going wrong.

Please verify that your current time information are correct (both the time and the region).
Having this information incorrect will lead to the stream query to be invalid and consequently having the 410 error.

Regards,
Linvi
Marked as answer by linvi on 3/9/2014 at 11:24 AM
Mar 11, 2014 at 5:13 PM
Hi Linvi

The error following
Tweet.PublishTweet("This is a test of the station tannoy system." + Guid.NewGuid());

is
StatusCode 401
TwitterDescription "Unauthorized - Authentication credentials were missing or incorrect." string

I have set the 4 authentication fields carefully from the details at https://dev.twitter.com/apps/<MYAPPID>/oauth
I had assumed that since
var loggedUser = User.GetLoggedUser();
is working that my authentication details were definitely correct.

My development machine time and region are correct
The time and region of the twitter account associated with the twitter application are correct.
Coordinator
Mar 11, 2014 at 5:53 PM
Hi MartR,

I do not understand what could be going wrong at this point.
If you are willing to share your credentials with me (private message), I can have a further investigation of your issue.
As always, I will never use your credentials but to identify your problem and resolve this specific issue.

Linvi
Mar 12, 2014 at 9:12 AM
Thanks for your help with this. I have resolved the issue.

It was not obvious to me that when changing the application access level (I changed this from Read Only to Read, write, and direct messages) that the keys needed to be regenerated. So in effect the problem was that I only had read only access - which explains why I could access the interface to read the user details and filtered stream but could not Tweet.

I regenerated all keys and plugged them into the program and it now seems to work fine.

(For info, one other thing I noticed was that the 401 can be caused if the Callback URL is not filled in)