Twitter Tweeting
Use this board to post your code snippets - tips and tricks
Hello,
16th November 2010 - THIS METHOD NO LONGER WORKS - PLEASE SEE TWITTER API: http://dev.twitter.com/pages/libraries
I WILL REMOVE (ARCHIVE) THIS TOPIC WHEN AN UPDATED TUTORIAL BECOMES AVAILABLE
This is a requested snip on how to update your Twitter page from an application. There are many ways to do this but this is the quickest solution.
Before we do anything we need to add the following to the start of our code:
Use this code within your buttons click event:
TextBox1 - Username
TextBox2 - Password
TextBox3 - Tweet Message
Then in the buttons click event use this code:
Happy coding! cooll;
16th November 2010 - THIS METHOD NO LONGER WORKS - PLEASE SEE TWITTER API: http://dev.twitter.com/pages/libraries
I WILL REMOVE (ARCHIVE) THIS TOPIC WHEN AN UPDATED TUTORIAL BECOMES AVAILABLE
This is a requested snip on how to update your Twitter page from an application. There are many ways to do this but this is the quickest solution.
Before we do anything we need to add the following to the start of our code:
Code: Select all
To build this into your application you will need to add a "Button" and "TextBox" control to your form, in this example "TextBox1" holds the tweet message you wish to send.Imports System.Net
Use this code within your buttons click event:
Code: Select all
If you want to manually input your Twitter details using your application you will need to add "Button" and 3 "TextBox" controls used as follows in the code:Using Twitter As New WebClient Twitter.Credentials = New NetworkCredential("USERNAME", "PASSWORD") ServicePointManager.Expect100Continue = False Dim MyTweet = System.Text.Encoding.UTF8.GetBytes("status=" & TextBox1.Text) Try Twitter.UploadData("http://twitter.com/statuses/update.xml", MyTweet) Catch ex As Exception MsgBox("The birds flew the nest, unable to tweet please try again in a few minutes.") End Try End Using
TextBox1 - Username
TextBox2 - Password
TextBox3 - Tweet Message
Then in the buttons click event use this code:
Code: Select all
Cali Alec has made a brilliant Twitter application so please have a look and try it out here: viewtopic.php?f=54&t=164Using Twitter As New WebClient Twitter.Credentials = New NetworkCredential(TextBox1.Text, TextBox2.Text) ServicePointManager.Expect100Continue = False Dim MyTweet = System.Text.Encoding.UTF8.GetBytes("status=" & TextBox3.Text) Try Twitter.UploadData("http://twitter.com/statuses/update.xml", MyTweet) Catch ex As Exception MsgBox("The birds flew the nest, unable to tweet please try again in a few minutes.") End Try End Using
Happy coding! cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Well, I never understood exactly what twitter is, probably because I never used, but this seems interesting, is it used to publish anything you want, like applications, threads, conversations?
I like to see the complexity in a so small code, congratulations.
I like to see the complexity in a so small code, congratulations.
thx for the article i will try this out and yea
Robby1998
Robby1998
I decided to let you download the code instead of typing the code.
You do not have the required permissions to view the files attached to this post.
Is it possible to fix something like this for facebook?
Just another day in my life.
http://www.codexvideos.com
http://www.codexvideos.com
Hello Scottie,
Neat App not kean on the design but its for your son so basicly none of my buisness But the features look handy!
Thanks, Lewis
Neat App not kean on the design but its for your son so basicly none of my buisness But the features look handy!
Thanks, Lewis
You could make it so he could see how many tweets he have posted.
On the tweet button:
LabelX.Text = LabelX.Text + 1
Just change the X to the nr. of the lable ;p
and name the label 0
code:
On the tweet button:
LabelX.Text = LabelX.Text + 1
Just change the X to the nr. of the lable ;p
and name the label 0
code:
Code: Select all
Using Twitter As New WebClient
Twitter.Credentials = New NetworkCredential(TextBox1.Text, TextBox2.Text)
ServicePointManager.Expect100Continue = False
Dim MyTweet = System.Text.Encoding.UTF8.GetBytes("status=" & TextBox3.Text)
Try
Twitter.UploadData("http://twitter.com/statuses/update.xml", MyTweet)
LabelX.Text = LabelX.Text + 1
Catch ex As Exception
MsgBox("The birds flew the nest, unable to tweet please try again in a few minutes.")
End Try
End Using
Just another day in my life.
http://www.codexvideos.com
http://www.codexvideos.com
Copyright Information
Copyright © Codenstuff.com 2020 - 2023