CsharpTwitt - REST API Methods (Timeline Methods)

Public Timeline method support XML, RSS, JSON and ATOM format.
Returns the 20 most recent statuses from non-protected users who have set a custom user icon. The public timeline is cached for 60 seconds so requesting it more often than that is a waste of resources.

Requires Authentication : false
Example
Twitter.PublicTwitt pubTwitt = new Twitter.PublicTwitt();
string strResult = "";
XmlDocument xmlResult = null;

strResult = pubTwitt.GetPublicTimeline(Twitter.OutputFormatType.xml);
strResult = pubTwitt.GetPublicTimelineAsJSON();
xmlResult = pubTwitt.GetPublicTimelineAsXML();
xmlResult = pubTwitt.GetPublicTimelineAsAtom();
xmlResult = pubTwitt.GetPublicTimelineAsRSS();


Home Timeline method support XML, JSON and ATOM format.
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetHomeTimeline(strUsername, strPassword, Twitter.OutputFormatType.xml);
xmlResult = userTwitt.GetHomeTimelineAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetHomeTimelineAsXML(strUsername, strPassword);
strResult = userTwitt.GetHomeTimelineAsJSON(strUsername, strPassword);


Friends Timeline method support XML, JSON, RSS and ATOM format.
Returns the 20 most recent statuses posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
Note: Retweets will not appear in the friends_timeline for backwards compatibility.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetFriendsTimeline(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetFriendsTimelineAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetFriendsTimelineAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetFriendsTimelineAsXML(strUsername, strPassword);
xmlResult = userTwitt.GetFriendsTimelineAsRSS(strUsername, strPassword);


User Timeline method support XML, JSON, RSS and ATOM format.
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter. This is the equivalent of the Web /<user> page for your own user, or the profile page for a third party.
Note: For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom).

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetUserTimeline(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetUserTimelineAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetUserTimelineAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetUserTimelineAsXML(strUsername, strPassword);
xmlResult = userTwitt.GetUserTimelineAsRSS(strUsername, strPassword);


Mentions method support XML, JSON, RSS and ATOM format.
Returns the 20 most recent mentions (status containing @username) for the authenticating user.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetMentions(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetMentionsAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetMentionsAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetMentionsAsXML(strUsername, strPassword);
xmlResult = userTwitt.GetMentionsAsRSS(strUsername, strPassword);


Retweeted_By_Me method support XML, JSON and ATOM format.
Returns the 20 most recent retweets posted by the authenticating user.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetRetweeted_By_Me(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetRetweeted_By_MeAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetRetweeted_By_MeAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetRetweeted_By_MeAsXML(strUsername, strPassword);


Retweeted_To_Me method support XML, JSON and ATOM format.
Returns the 20 most recent retweets posted by the authenticating user's friends.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetRetweeted_To_Me(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetRetweeted_To_MeAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetRetweeted_To_MeAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetRetweeted_To_MeAsXML(strUsername, strPassword);


Retweets_Of_Me method support XML, JSON and ATOM format.
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.

Requires Authentication : true
Example
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strUsername = "TwitterUsername";
string strPassword = "TwitterPassword";
string strResult = "";
XmlDocument xmlResult = null;

strResult = userTwitt.GetRetweets_Of_Me(strUsername, strPassword, Twitter.OutputFormatType.xml);
strResult = userTwitt.GetRetweets_Of_MeAsJSON(strUsername, strPassword);
xmlResult = userTwitt.GetRetweets_Of_MeAsAtom(strUsername, strPassword);
xmlResult = userTwitt.GetRetweets_Of_MeAsXML(strUsername, strPassword);

Comments

Hello,
I have using your code project, but not work, please help me this problem. Thanks a lot
private void FriendTimeLine(string strUsername, string strPassword)
{
XmlDocument xmlResult = null;
XmlNode nodestatuses, nodestatus, nodescreen_name;
Twitter.UserTwitt userTwitt = new Twitter.UserTwitt();
string strResult = "";
xmlResult = new XmlDocument();
xmlResult = userTwitt.GetFriendsTimelineAsXML(strUsername, strPassword, Twitter.OutputFormatType.xml);

// Loop for the tag
for (int i = 0; i < xmlResult.ChildNodes.Count; i++)
{
// If it is the statuses tag
if (xmlResult.ChildNodes[i].Name == "statuses")
{
// tag found
nodestatuses = xmlResult.ChildNodes[i];
}
}
// Loop for the tag
for (int i = 0; i < nodestatuses.ChildNodes.Count; i++)
{
// If it is the status tag
if (nodestatuses.ChildNodes[i].Name == "status")
{
// tag found
nodestatus = nodestatuses.ChildNodes[i];
string textid = nodestatus["id"].InnerText;
string text = nodestatus["text"].InnerText;
string screen_name = "";
string screen_nameid = "";
// tag found
for (int j = 0; j < nodestatus.ChildNodes.Count; j++)
{
if (nodestatus.ChildNodes[j].Name == "user")
{
// , tag found
nodescreen_name = nodestatus.ChildNodes[j];
screen_name = nodescreen_name["screen_name"].InnerText;
screen_nameid = nodescreen_name["id"].InnerText;
}
}
txtMessages.Text = textid + "-" + screen_name + "-" + text;
}
}
txtMessages.Text = strResult;
}

Popular posts from this blog

To Move items from one ListBox to another Listbox

Receive Json Web response in C#