Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Topic author was deleted

    Feb 04, 2016 @ 15:06

    Setting up a twitter feed

    Hi Anders,

    Great work on this package! I'm just testing it and trying to setup a simple twitter feed but seems like your code on http://social.skybrud.dk/umbraco-package/umbraco-7/ is outdated.

    So I've managed to create the twitter auth datatype, added that to my hompage doctype and authentication was a success... all good so far... next I want to add my recent tweets on the homepage and that is where your example code fails... so I assume something changes since then...

    Would be ace if you could point me in the right direction! THanks :)

  • Comment author was deleted

    Feb 04, 2016 @ 15:12

    Ok should have looked around a bit better, got to this snippet so far

    @using Skybrud.Social.Twitter
    @using Skybrud.Social.Twitter.Objects
    @using Skybrud.Social.Umbraco.Twitter.PropertyEditors.OAuth
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "Master.cshtml";
    }
    @{
    
    // Get the OAuth information stored in the property
    TwitterOAuthData twitter = Model.Content.GetPropertyValue("twitterAuth") as TwitterOAuthData;
    
    
    // Check whether the OAuth data is valid
    if (twitter != null && twitter.IsValid) {
    
        // Gets an instance of TwitterService based on the OAuth data
        var service = twitter.GetService();
    
        // Get information about the authenticated user
        var user = service.Users.GetUser(twitter.Id);
    
    
        // Get recent status messages (tweets) from the authenticated user
        var recent = service.Statuses.GetUserTimeline(user.Body.Id);
    
        <fieldset>
            <legend>Twitter</legend>
            <p>@user.Body.Name (ID: @user.Body.Id)</p>
            <hr />
            @foreach (var status in recent.Body) {
                <p>@status.Text</p>
            }
        </fieldset>
    
    }
    
    }
    

    But nothing being outputted so far

  • Comment author was deleted

    Feb 04, 2016 @ 15:16

    Ok nevermind the above snippet works fine :) my prop wasn't populated doh!

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Feb 04, 2016 @ 15:29
    Anders Bjerner
    3

    Seems like you have found a solution :D

    Yes, the Umbraco examples seems to be a bit outdated. I will have a look at that.

    The part of the documentation specific to Twitter should be updated - eg. here: http://social.skybrud.dk/twitter/endpoints/statuses/user-timeline/

    But let me know if you need any further help (or just stumbles upon some more outdated documentation).

  • Comment author was deleted

    Feb 04, 2016 @ 15:30

    Thanks Anders! And again nice work and thanks for sharing! #H5yr

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Feb 04, 2016 @ 17:44
    Anders Bjerner
    3

    The package page has now been updated with examples that actually works with the most recent version ;)

  • Gavin Hoare 11 posts 81 karma points
    Sep 25, 2016 @ 00:17
    Gavin Hoare
    0

    Hi Anders,

    I'm new to umbraco and learning but I have some experience with coding twitter feeds into websites. My question is that I'm using the code posted on the skybrud website though I'm coming with a few errors (screen shoot below).

    I did also try the one from Tim yet that doesn't let you specify how many tweets it loads and is not adhering to page set styles (no links, text or anything).

    enter image description here

    I did try fixing these errors however no luck so far.

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Sep 25, 2016 @ 13:23
    Anders Bjerner
    0

    Hi Gavin,

    Based on the screenshot, it seems that you are missing some imports (using statements), but you have cropped the YSOD, so I can't really tell for sure. If you're still seeing this error, could you please post the full YSOD? Of course feel free to blank out any sensitive information (eg. if the YSOD contains your Twitter API keys).

    If you could post your code here as well (or at least some of it), that would make it much easier for me to come with any tips. Again - feel free to blank out any sensitive information.

  • Gavin Hoare 1 post 20 karma points
    Oct 03, 2016 @ 14:54
    Gavin Hoare
    0

    I finally got Two twitter plugins working on separate local servers. My question is though for the Skybrud.social version.

    How can I force the text to accept link as well as retweets and stuff like that?

    In my opinion uTwit is the better layout and as the code is already there, just need the like tag though I would prefer getting Skybrud version to work just the same as I also need a facebook plugin as well and would hate to have use a second plugin

Please Sign in or register to post replies

Write your reply to:

Draft