twitter client with api

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
9 posts Page 1 of 1
Contributors
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

twitter client with api
volttide
first download the twitter dll
here:
TwitterVB-2.5.zip
Then follow my step

add 4 textbox
name
txtCostumerKey
txtCostumerKeySecret
txtToken
txtTokenSecret

add 1 textbox name txtStatus

add 1 richtextbox name txtTweets , readonly true

add one button name btnTweet

add one label text: What's happening?

save your project

then open My Project, in compile, click Advance Compile Options...

then change the .Net frame work to .Net Framework 3.5

codes:
before public class add
Code: Select all
Imports TwitterVB2
after public class add
Code: Select all
Dim twitter As New TwitterAPI
form load:
Code: Select all
twitter.AuthenticateWith(txtCostumerKey.Text, txtCostumerKeySecret.Text, txtToken.Text, txtTokenSecret.Text)

        For Each tweet As TwitterStatus In twitter.HomeTimeline


            txtTweets.AppendText(tweet.User.ScreenName + vbNewLine + tweet.Text + vbNewLine + vbNewLine)

        Next
Me.Text = twitter.AccountInformation.ScreenName
btnTweet code:
Code: Select all
Dim TweetStatus As TwitterStatus = twitter.Update(txtStatus.Text)

        MsgBox("Tweet successfully")

        txtStatus.Text = ""
txtStatus code:
Code: Select all
If txtStatus.Text = "" Then
            btnTweet.Enabled = False
        Else
            btnTweet.Enabled = True
        End If
Now how to get txtCostumerKey, CostumerKeySecret,Token, TokenSecret?

sign in your twitter, then go to https://dev.twitter.com/apps/new . Then Register your application.
You do not have the required permissions to view the files attached to this post.
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: twitter client with api
Filip
When I debug app it showes me this:
Code: Select all
TwitterAPIException was unhandled
  AuthType=OAUTH
  Message=Exception of type 'TwitterAPIException' was thrown.
  Method=POST
  Source=TwitterVB
  Url=http://api.twitter.com/1/statuses/update.xml
  StackTrace:
       at TwitterVB2.TwitterOAuth.WebRequest(Method RequestMethod, String Url, String PostData)
       at TwitterVB2.TwitterOAuth.OAuthWebRequest(Method RequestMethod, String url, String PostData)
       at TwitterVB2.TwitterAPI.PerformWebRequest(String Url, String HTTPMethod)
       at TwitterVB2.TwitterAPI.Update(String Text)
       at WindowsApplication17.twt.Button1_Click(Object sender, EventArgs e) in D:\Users\WIM2\Documents\visual studio 2010\Projects\AppBar\AppBar\twitter.vb:line 28
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WindowsApplication17.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Net.WebException
       Message=The remote server returned an error: (401) Unauthorized.
       Source=System
       StackTrace:
            at System.Net.HttpWebRequest.GetResponse()
            at TwitterVB2.TwitterOAuth.WebRequest(Method RequestMethod, String Url, String PostData)
       InnerException: 
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

Re: twitter client with api
volttide
after you download twitter dll, then add that dll in reference to your program
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: twitter client with api
Filip
I added it as refrence..
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

Re: twitter client with api
volttide
What visual basic version do you use, and what framework is in the twitter client?
Have you register your application? place the Consumer key, Consumer secret, Access token, Access token secret?
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: twitter client with api
Filip
volttide wrote:
What visual basic version do you use, and what framework is in the twitter client?
Have you register your application? place the Consumer key, Consumer secret, Access token, Access token secret?
Visual Studio 2010 Ultimate
.NET Framework 3.5
Yes
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

Re: twitter client with api
volttide
User avatar
corliansa
Just Registered
Just Registered
Posts: 2
Joined: Sat Oct 13, 2012 9:19 am

Re: twitter client with api
corliansa
error :
A unhandled exception exception of type 'TwitterAPIException' occurred in TwitterVB.dll
can you correct my file please :
Twitter.rar
can you pm me if you're done correcting my file
You do not have the required permissions to view the files attached to this post.
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: twitter client with api
Shim
corliansa wrote:
error :
A unhandled exception exception of type 'TwitterAPIException' occurred in TwitterVB.dll
can you correct my file please :
Twitter.rar
can you pm me if you're done correcting my file
this is not working anymore :geek:
Find my programs on Softpedia
9 posts Page 1 of 1
Return to “Tutorials”