RetweetsOfMe something changes?

Feb 18, 2012 at 5:51 PM

I use the following snippet of code to get the retweets of me and to get the retweeting user for each retweeted status. How to get the retweeting users? At the moment this code prints always my name for each friendTweets... in some example and in some discussion I've seen the property RetweetingUser but I dont find that property in the lastest download... I took a peek into the source code and indeed the property doesnt exist. Does someone can help me?

                var publicTweets =
                                from tweet in twitterCtx.Status
                                where 1== 1
                                    && tweet.Type == StatusType.RetweetsOfMe
                                select tweet;

                publicTweets.ToList().ForEach(
                    tweet =>
                    {
                        Console.WriteLine(
                            "@{0} {1} ({2})",
                                tweet.User.Identifier.ScreenName,
                                tweet.Text,
                                tweet.RetweetCount);

                        var friendTweets =
                            from rtweet in twitterCtx.Status
                            where 1 == 1
                                   && rtweet.Type == StatusType.Retweets  
                                   && rtweet.ID== tweet.StatusID
                            select tweet;

                        friendTweets.ToList().ForEach(friendTweet =>
                        {
                            Console.WriteLine(".@{0}", friendTweet.User.Identifier.ScreenName);
                        });
                    });
Thank you in advance,
M.
Coordinator
Feb 20, 2012 at 12:48 AM

Hi Markino,

It looks like a typo that you can fix by changing the projection in the Retweets query to rtweet instead of tweet.

Instead of this:

                var publicTweets =
                                from tweet in twitterCtx.Status
                                where 1== 1
                                    && tweet.Type == StatusType.RetweetsOfMe
                                select tweet;

                publicTweets.ToList().ForEach(
                    tweet =>
                    {
                        Console.WriteLine(
                            "@{0} {1} ({2})",
                                tweet.User.Identifier.ScreenName,
                                tweet.Text,
                                tweet.RetweetCount);

                        var friendTweets =
                            from rtweet in twitterCtx.Status
                            where 1 == 1
                                   && rtweet.Type == StatusType.Retweets  
                                   && rtweet.ID== tweet.StatusID
                            select tweet;

                        friendTweets.ToList().ForEach(friendTweet =>
                        {
                            Console.WriteLine(".@{0}", friendTweet.User.Identifier.ScreenName);
                        });
                    });

 Do this:

                var publicTweets =
                                from tweet in twitterCtx.Status
                                where 1== 1
                                    && tweet.Type == StatusType.RetweetsOfMe
                                select tweet;

                publicTweets.ToList().ForEach(
                    tweet =>
                    {
                        Console.WriteLine(
                            "@{0} {1} ({2})",
                                tweet.User.Identifier.ScreenName,
                                tweet.Text,
                                tweet.RetweetCount);

                        var friendTweets =
                            from rtweet in twitterCtx.Status
                            where 1 == 1
                                   && rtweet.Type == StatusType.Retweets  
                                   && rtweet.ID== tweet.StatusID
                            select rtweet;

                        friendTweets.ToList().ForEach(friendTweet =>
                        {
                            Console.WriteLine(".@{0}", friendTweet.User.Identifier.ScreenName);
                        });
                    });

Hope this helps, 

@JoeMayo

 

Feb 20, 2012 at 9:13 AM

OMG you are right! Sorry for the question Joe, it was my fault, "copy and paste" will destroy the world! ;)

have a good work!

M.