本文整理匯總了C#中TweetSharp.TwitterService.ListRetweetsByMe方法的典型用法代碼示例。如果您正苦於以下問題:C# TwitterService.ListRetweetsByMe方法的具體用法?C# TwitterService.ListRetweetsByMe怎麽用?C# TwitterService.ListRetweetsByMe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TweetSharp.TwitterService
的用法示例。
在下文中一共展示了TwitterService.ListRetweetsByMe方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PostToReader
public static List<string> PostToReader(string _consumerKey, string _consumerSecret, string _accessToken, string _accessTokenSecret, string gUsername, string gPassword, bool chkTweets, bool chkFavorites, bool chkRetweets, bool chkLinks, bool chkNoLinks)
{
List<string> res = new List<string>();
GoogleReader gr = new GoogleReader(gUsername, gPassword);
var serviceReader = new TwitterService(_consumerKey, _consumerSecret);
serviceReader.AuthenticateWith(_accessToken, _accessTokenSecret);
Regex urlfind = new Regex("((https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])", RegexOptions.IgnoreCase);
List<TwitterStatus> mytweets =null;
List<TwitterStatus> favorites=null;
List<TwitterStatus> retweets =null;
if (chkTweets) mytweets = serviceReader.ListTweetsOnUserTimeline(5).ToList();
if (chkFavorites) favorites = serviceReader.ListFavoriteTweets(5).ToList();
if (chkRetweets) retweets = serviceReader.ListRetweetsByMe(5).ToList();
List<TwitterStatus> alltweets = new List<TwitterStatus>();
if (mytweets != null) alltweets.AddRange(mytweets);
if (favorites != null) alltweets.AddRange(favorites);
if (retweets != null) alltweets.AddRange(retweets);
foreach (var tweet in alltweets)
{
if (hassent(tweet.Id.ToString())) { continue; }
Match thematch = urlfind.Match(tweet.Text);
if (thematch.Success)
{
if (chkLinks)
{
string theshorturl = thematch.Groups[1].Value;
string theurl = thematch.Groups[1].Value;
try
{
string longurlxml = c.DownloadString("http://api.unshort.me/?r=" + theurl);
Regex resUrl = new Regex("<resolvedURL>(.*?)</resolvedURL>");
Match resolved = resUrl.Match(longurlxml);
if (resolved.Success)
{
theurl = resolved.Groups[1].Value;
}
}
catch
{
}
string title;
string content = embed(theurl, out title);
gr.post(content, theurl, title, tweet.Text.Replace(theshorturl, "").Trim());
AddID(tweet.Id.ToString(), tweet.Text);
}
}
else if (chkNoLinks)
{
gr.post("", "http://twitter.com/" + tweet.User.ScreenName + "/status/" + tweet.Id, "from twitter", tweet.Text.Trim());
AddID(tweet.Id.ToString(), tweet.Text);
}
res.Add( DateTime.Now.ToShortTimeString() + ": " + tweet.Text);
}
return res;
}