Photo doesn't show in browser

61 views Asked by At

I am making a web application in asp.net with MVC 4 and i'm trying to show the user twitter home feed. To get the user home feed i'm using twitterizer2. Everything work fine and i have the user home feed and the feed photo link but it doesn't display in the browser. If i open the picture link from the browser address bar it is displayed and also if i use another photo link not related with twitter everything works fine. So i'm guessing it has something to do with twitter.

My view is this:

 <div class="NoBullets" style="font-size:@Model.TextSize">
    <ul style="list-style-type:none">

        @foreach (var status in Model.TStatusCollection)
        {

            <li>
                <a href="http://twitter.com/#!/@status.User.ScreenName"><img [email protected] style="float:left" width="48" height="48" align="bottom"> @status.Text</a><br />
               @string.Format("{0:dd MMMM yyyy} {0:H:mm}", status.CreatedDate)
            </li>

        }
    </ul>
</div>

And the model:

 public class PortletMyTwitter : PortletBase
{

    private int noOfTweets = 15;
    private string textSize = "medium";
    private string userExtAppID;
    private TwitterStatusCollection tStatusCollection;



    private IList<object> noOfTweetsList = new List<object>()
    {
    new {value = 5},
    new {value = 10},
    new {value = 15},
    new {value = 20},
    new {value = 25}
    };

    private IList<object> textSizeList = new List<object>()
    {
    new {value = "small"},
    new {value = "medium"},
    new {value = "large"}
    };


    public string UserExtAppID
    {
        get { return userExtAppID; }
        set { userExtAppID = value; }
    }


    public IList<object> NoOfTweetsList
    {
        get { return noOfTweetsList; }
    }

    public int NoOfTweets
    {
        get { return noOfTweets; }
        set { noOfTweets = value; }
    }

    public IList<object> TextSizeList
    {
        get { return textSizeList; }
    }

    public string TextSize
    {
        get { return textSize; }
        set { textSize = value; }
    }

    public TwitterStatusCollection TStatusCollection
    {
        get { return tStatusCollection; }
    }

    public void GetSettings(XmlDocument xmlPortletState)
    {

        if (xmlPortletState.GetElementsByTagName("UserExtAppID").Count > 0)
        {
            if (xmlPortletState.GetElementsByTagName("UserExtAppID")[0].FirstChild != null)
                UserExtAppID = ((System.Xml.XmlText)(xmlPortletState.GetElementsByTagName("UserExtAppID")[0]).FirstChild).Value;

        }

        if (xmlPortletState.GetElementsByTagName("HideHeader").Count > 0)
        {
            if (xmlPortletState.GetElementsByTagName("HideHeader")[0].FirstChild != null)
                HideHeader = bool.Parse(((System.Xml.XmlText)(xmlPortletState.GetElementsByTagName("HideHeader")[0]).FirstChild).Value);
        }

        if (xmlPortletState.GetElementsByTagName("TextSize").Count > 0)
        {
            if (xmlPortletState.GetElementsByTagName("TextSize")[0].FirstChild != null)
                try
                {
                    TextSize = ((System.Xml.XmlText)(xmlPortletState.GetElementsByTagName("TextSize")[0]).FirstChild).Value;
                }
                catch
                {
                    TextSize = "medium";
                }
        }

        if (xmlPortletState.GetElementsByTagName("NoOfTweets").Count > 0)
        {
            if (xmlPortletState.GetElementsByTagName("NoOfTweets")[0].FirstChild != null)
                try
                {
                    NoOfTweets = Convert.ToInt32(((System.Xml.XmlText)(xmlPortletState.GetElementsByTagName("NoOfTweets")[0]).FirstChild).Value);
                }
                catch
                {
                    NoOfTweets = 10;
                }

        }

        UpdateFeed();
    }

    protected void UpdateFeed()
    {
        try
        {
            OAuthTokens oauthTokens = new OAuthTokens()
            {
                AccessToken = "",
                AccessTokenSecret = "",
                ConsumerKey = "",
                ConsumerSecret = ""
            };

            TimelineOptions myOptions = new TimelineOptions();
            myOptions.IncludeRetweets = false;
            myOptions.UseSSL = true;
            myOptions.APIBaseAddress = "https://api.twitter.com/1.1/";
            myOptions.Count = NoOfTweets;

            TwitterResponse<TwitterStatusCollection> twitterDataSource = TwitterTimeline.HomeTimeline(oauthTokens, myOptions);
            tStatusCollection = twitterDataSource.ResponseObject;

        }
        catch (Exception)
        {


        }

    }

}
0

There are 0 answers