Retweet User Profile Image

Feb 23, 2012 at 7:30 AM

Thanks so much for this web part - you saved us. All other Twitter webparts give major performance issues.

It's working perfectly. I've have done a minor tweak on my side just to check for a Re-tweet and display that tweets user profile pic instead. Personally I prefer it :)

Thanks again

If interested: Code Change (TwitterHelper.cs - GetTweets)

 		    if (loadAvatarUsingSsl)
                    {
                        if (status.SelectSingleNode("retweeted_status") != null)
                        {
                            tweet.AvatarUrl = status.SelectSingleNode("retweeted_status/user/profile_image_url_https").InnerText;
                            tweet.UserName = status.SelectSingleNode("retweeted_status/user/screen_name").InnerText;
                        }
                        else
                        {
                            tweet.AvatarUrl = status.SelectSingleNode("user/profile_image_url_https").InnerText;
                            tweet.UserName = status.SelectSingleNode("user/screen_name").InnerText;
                        }                        
                    }
                    else
                    {
                        if (status.SelectSingleNode("retweeted_status") != null)
                        {
                            tweet.AvatarUrl = status.SelectSingleNode("retweeted_status/user/profile_image_url").InnerText;
                            tweet.UserName = status.SelectSingleNode("retweeted_status/user/screen_name").InnerText;
                        }
                        else 
                        {
                            tweet.AvatarUrl = status.SelectSingleNode("user/profile_image_url").InnerText;
                            tweet.UserName = status.SelectSingleNode("user/screen_name").InnerText;
                        }                        
                    }

 

 

 

Coordinator
Feb 23, 2012 at 2:06 PM

Hi Craig,

Thanks for the kind feedback as well as the code suggestion. I'll fold this into the project and redeploy over the weekend.

Cheers!
John