Skip to content

Commit a5204d9

Browse files
committedJul 4, 2013
Changed constructor names to reflect Twitter terminology.
Added console output for more fields to test property population. Updated ReadMe with more info. Changed the order of constructor parameters to fit the example.
1 parent 3ff08d4 commit a5204d9

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed
 

‎Example/Program.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ static void Main(string[] args)
3838
// Loop through the returned Tweets.
3939
foreach (var t in tweets)
4040
{
41-
Console.WriteLine(t.UserName + ": " + t.Status);
41+
Console.WriteLine("UserName: " + t.UserName);
42+
Console.WriteLine("DisplayName: " + t.DisplayName);
43+
Console.WriteLine("ProfileImage: " + t.ProfileImage);
44+
Console.WriteLine("StatusDate: " + t.StatusDate.ToString("dddd, dd MMMM yyyy - hh:mmtt"));
45+
Console.WriteLine("Status: " + t.Status);
46+
Console.WriteLine();
4247
}
4348

4449
// Wait

‎README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
TwitterAPI
2-
==========
1+
# TwitterAPI
32

43
A class to make integrating with the new Twitter API easy.
4+
5+
Twitter API 1.1 requires you to create API keys on the developer site.
6+
7+
1. Login to Twitter Dev site with the account you want to use. [https://dev.twitter.com/](https://dev.twitter.com/)
8+
2. Go to "My Applications" [https://dev.twitter.com/apps](https://dev.twitter.com/apps)
9+
3. Create a new Twitter app. Fill in all fields, but leave Callback_Url blank.
10+
4. After the app is created, go to its detail page and create an access token for it.
11+
5. You need **Consumer Key**, **Consumer Secret**, **Access Token**, and **Access Token Secret**. (In that order)
12+
13+
NOTE: Sometimes Twitter is slow or down, so it is best to consume the Tweet class from a web service which is called from JavaScript after the page has loaded to reduce page load time.

‎TwitterAPI/Tweet.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ public class Tweet
2828

2929
#region Private Members
3030

31-
private String ApiKey = String.Empty;
32-
private String ApiToken = String.Empty;
31+
private String ConsumerKey = String.Empty;
3332
private String ConsumerSecret = String.Empty;
34-
private String TokenSecret = String.Empty;
33+
private String AccessToken = String.Empty;
34+
private String AccessTokenSecret = String.Empty;
3535

3636
#endregion
3737

3838
#region Constructors
3939

40-
public Tweet(String apiKey,
41-
String apiToken,
40+
public Tweet(String consumerKey,
4241
String consumerSecret,
43-
String tokenSecret)
42+
String accessToken,
43+
String accessTokenSecret)
4444
{
45-
ApiKey = apiKey;
46-
ApiToken = apiToken;
45+
ConsumerKey = consumerKey;
4746
ConsumerSecret = consumerSecret;
48-
TokenSecret = tokenSecret;
47+
AccessToken = accessToken;
48+
AccessTokenSecret = accessTokenSecret;
4949
}
5050

5151
public Tweet()

0 commit comments

Comments
 (0)
Please sign in to comment.