本文整理汇总了C#中GlobusTwitterLib.App.Core.TwitterUser类的典型用法代码示例。如果您正苦于以下问题:C# TwitterUser类的具体用法?C# TwitterUser怎么用?C# TwitterUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TwitterUser类属于GlobusTwitterLib.App.Core命名空间,在下文中一共展示了TwitterUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rate_Limit_Status
/// <summary>
/// this Method Will
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <returns>Return Xml Text With User Details</returns>
public XmlDocument Rate_Limit_Status(TwitterUser User)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string response = twtWebReq.PerformWebRequest(User, Globals.RateLimitStatusUrl, "GET", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例2: getFriendsofFriends
public List<string> getFriendsofFriends(string FriendId, TwitterUser twitterUser, string goodProxy)
{
List<string> followersOfFriend = new List<string>();
XmlDocument xmlDoc = new XmlDocument();
TwitterWebRequest twitterWebRequest = new TwitterWebRequest();
Dictionary<string, string> dic = getUserInfo(twitterUser, FriendId, goodProxy);
int noofFollowers = Int32.Parse(dic["NoOfFriends"].ToString());
string FriendIds = "";
int pageno = 1;
if (noofFollowers > 5000)
{
pageno = noofFollowers / 5000;
int temp = noofFollowers % 5000;
if (temp > 10)
pageno++;
FriendIds = twitterWebRequest.PerformWebRequest(twitterUser, Globals.getFriendsUrl + FriendId + ".xml?page=" + pageno, "GET", true, goodProxy);
}
else
{
FriendIds = twitterWebRequest.PerformWebRequest(twitterUser, Globals.getFriendsUrl + FriendId + ".xml?page=1", "GET", true, goodProxy);
}
xmlDoc.Load(new StringReader(FriendIds));
XmlNodeList xmlNodeList = xmlDoc.GetElementsByTagName("id");
foreach (XmlNode xmlNode in xmlNodeList)
{
followersOfFriend.Add(xmlNode.InnerText.ToString());
}
return followersOfFriend;
}
示例3: PerformWebRequest
/// <summary>
///
/// </summary>
/// <param name="twitterUser"></param>
/// <param name="uri"></param>
/// <param name="HTTPMethod"></param>
/// <param name="IsAuthenticationRequire"></param>
/// <param name="goodProxy"></param>
/// <returns></returns>
public string PerformWebRequest(TwitterUser twitterUser,string uri, string HTTPMethod,bool IsAuthenticationRequire,string goodProxy)
{
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(uri );
Request.Method = HTTPMethod;
StreamReader readStream;
Request.MaximumAutomaticRedirections = 4;
Request.MaximumResponseHeadersLength = 4;
Request.ContentLength = 0;
//Globals.RequestCount++;
if(IsAuthenticationRequire)
Request.Credentials = new NetworkCredential(twitterUser.TwitterUserName , twitterUser.TwitterPassword);
HttpWebResponse Response;
string strResponse="";
try
{
Response = (HttpWebResponse)Request.GetResponse();
Stream receiveStream = Response.GetResponseStream();
readStream = new StreamReader(receiveStream);
strResponse = readStream.ReadToEnd();
Response.Close();
readStream.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message );
strResponse = ex.Message;
//Logger.LogText("Exception from Twitter:" + ex.Message,"");
}
return strResponse;
}
示例4: PostScheduleMessage
public override void PostScheduleMessage(dynamic data)
{
try
{
oAuthTwitter OAuthTwt = new oAuthTwitter();
TwitterAccountRepository fbaccrepo = new TwitterAccountRepository();
TwitterAccount twtaccount = fbaccrepo.getUserInformation(data.UserId, data.ProfileId);
OAuthTwt.CallBackUrl = System.Configuration.ConfigurationSettings.AppSettings["callbackurl"];
OAuthTwt.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["consumerKey"];
OAuthTwt.ConsumerKeySecret = System.Configuration.ConfigurationSettings.AppSettings["consumerSecret"];
OAuthTwt.AccessToken = twtaccount.OAuthToken;
OAuthTwt.AccessTokenSecret = twtaccount.OAuthSecret;
OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
OAuthTwt.TwitterUserId = twtaccount.TwitterUserId;
#region For Testing
// For Testing
//OAuthTwt.ConsumerKey = "udiFfPxtCcwXWl05wTgx6w";
//OAuthTwt.ConsumerKeySecret = "jutnq6N32Rb7cgbDSgfsrUVgRQKMbUB34yuvAfCqTI";
//OAuthTwt.AccessToken = "1904022338-Ao9chvPouIU8ejE1HMG4yJsP3hOgEoXJoNRYUF7";
//OAuthTwt.AccessTokenSecret = "Wj93a8csVFfaFS1MnHjbmbPD3V6DJbhEIf4lgSAefORZ5";
//OAuthTwt.TwitterScreenName = "";
//OAuthTwt.TwitterUserId = "";
#endregion
TwitterUser twtuser = new TwitterUser();
if (string.IsNullOrEmpty(data.ShareMessage))
{
data.ShareMessage = "There is no data in Share Message !";
}
JArray post = twtuser.Post_Status_Update(OAuthTwt, data.ShareMessage);
Console.WriteLine("Message post on twitter for Id :" + twtaccount.TwitterUserId + " and Message: " + data.ShareMessage);
ScheduledMessageRepository schrepo = new ScheduledMessageRepository();
schrepo.updateMessage(data.Id);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
Log log = new Log();
log.CreatedDate = DateTime.Now;
log.Exception = ex.Message;
log.Id = Guid.NewGuid();
log.ModuleName = "TwitterScheduler";
log.ProfileId = data.ProfileId;
log.Status = false;
LogRepository logRepo = new LogRepository();
logRepo.AddLog(log);
}
}
示例5: PostScheduleMessage
public override void PostScheduleMessage(dynamic data)
{
try
{
oAuthTwitter OAuthTwt = new oAuthTwitter();
TwitterAccountRepository fbaccrepo = new TwitterAccountRepository();
TwitterAccount twtaccount = fbaccrepo.getUserInformation(data.UserId, data.ProfileId);
OAuthTwt.CallBackUrl = System.Configuration.ConfigurationSettings.AppSettings["callbackurl"];
OAuthTwt.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["consumerKey"];
OAuthTwt.ConsumerKeySecret= System.Configuration.ConfigurationSettings.AppSettings["consumerSecret"];
OAuthTwt.AccessToken = twtaccount.OAuthToken;
OAuthTwt.AccessTokenSecret= twtaccount.OAuthSecret;
OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
TwitterUser twtuser = new TwitterUser();
JArray post = twtuser.Post_Status_Update(OAuthTwt, data.ShareMessage);
Console.WriteLine("Message post on twitter for Id :" + twtaccount.TwitterUserId + " and Message: " + data.ShareMessage);
ScheduledMessageRepository schrepo = new ScheduledMessageRepository();
schrepo.updateMessage(data.Id);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
示例6: Verify_Credentials
/// <summary>
/// This Method Will Check That User is Authenticated Or Not
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <returns>Return Xml Text With User Details</returns>
public XmlDocument Verify_Credentials(TwitterUser User)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string response = twtWebReq.PerformWebRequest(User, Globals.VerifyCredentialsUrl, "GET", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例7: SearchMethod
/// <summary>
/// This Method Will Get All Trends Of Twitter
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <returns>Json Text Of Trends</returns>
public XmlDocument SearchMethod(TwitterUser User, string SearchKey)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.SearchUrl + SearchKey;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Get", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例8: Friendships_Create
/// <summary>
/// Follow Twitter User
/// </summary>
/// <param name="twitterUser">Twitter UserName And Password</param>
/// <param name="UserToFollow">ScreenName Of Whom You Want To Follow</param>
/// <returns>Returm Xml</returns>
public XmlDocument Friendships_Create(TwitterUser User, string ScreenName)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.FollowerUrl + ScreenName;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Post", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例9: Friendships_Destroy
/// <summary>
/// UnFollow Twitter User
/// </summary>
/// <param name="twitterUser">Twitter UserName And Password</param>
/// <param name="UserToFollow">ScreenName Of Whom You Want To UnFollow</param>
/// <returns>Returm Xml</returns>
public XmlDocument Friendships_Destroy(TwitterUser User, int UserId)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.UnFollowUrlById + UserId;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Post", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例10: DirectMessage_Sent
/// <summary>
/// This Method Will Get All Direct Message Sent By User
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <param name="Count">Number Of DirectMessage Sent By User</param>
/// <returns>Xml Text Of DirectMessage Sent By User</returns>
public XmlDocument DirectMessage_Sent(TwitterUser User, string Count)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.DirectMessageSentByUserUrl + Count;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Get", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例11: ReTweetStatus
/// <summary>
/// This Method Will Retweet
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <param name="UserId">Tweet Id</param>
/// <returns></returns>
public XmlDocument ReTweetStatus(TwitterUser User, string Id)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.ReTweetStatus + Id + ".xml";
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Post", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例12: ShowStatusByScreenName
/// <summary>
/// This Method Will Show User Statues By ScreenName
/// </summary>
/// <param name="User">Twitter User Name And Password</param>
/// <param name="UserId">Twitter UserId Of User</param>
/// <returns></returns>
public XmlDocument ShowStatusByScreenName(TwitterUser User, string ScreenName)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.ShowStatusUrlByScreenName + ScreenName;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Get", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例13: Status_RetweetedByMe
/// <summary>
/// Get All ReTweets Sent By User
/// </summary>
/// <param name="User">Twitter User And Password</param>
/// <param name="Count">Number Of ReTweets</param>
/// <returns>Return XmlText Of ReTweets</returns>
public XmlDocument Status_RetweetedByMe(TwitterUser User, string Count)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.RetweetedByMeUrl + Count;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Get", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例14: UpdateStatus
/// <summary>
/// This Method Will Update Tweets On Twitter
/// </summary>
/// <param name="User">Twitter UserName And Password</param>
/// <param name="StatusText">Status Messages</param>
/// <returns>Return Xml Text Of Details</returns>
public XmlDocument UpdateStatus(TwitterUser User, string StatusText)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.UpdateStatusUrl + "?status=" + StatusText;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Post", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}
示例15: NewDirectMessage
/// <summary>
/// This will Send DirectMessage to the User
/// </summary>
/// <param name="User">Twitter UserName Password</param>
/// <param name="DirectMessage">DirectMessage</param>
/// <param name="UserId">USerId Whom You Want to Send Direct Message</param>
/// <returns></returns>
public XmlDocument NewDirectMessage(TwitterUser User, string DirectMessage, string ScreenName)
{
TwitterWebRequest twtWebReq = new TwitterWebRequest();
string RequestUrl = Globals.NewDirectMessage + "?screen_name=" + ScreenName + "&text=" + DirectMessage;
string response = twtWebReq.PerformWebRequest(User, RequestUrl, "Post", true, "");
xmlResult.Load(new StringReader(response));
return xmlResult;
}