本文整理汇总了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;
}