Esempio n. 1
0
        public JodelMainData ReloadMain()
        {
            Karma      = MyJodel.GetKarma();
            JodelPosts = MyJodel.GetPostLocationCombo();

            return(JodelPosts);
        }
Esempio n. 2
0
        public string Post(string message, JodelPost.PostColor color = JodelPost.PostColor.Random, bool home = false)
        {
            string postId = MyJodel.Post(message, color: color, home: home);

            JodelPosts = MyJodel.GetPostLocationCombo();
            return(postId);
        }
Esempio n. 3
0
 public void Start()
 {
     MyJodel.GetUserConfig();
     MyJodel.GetRecommendedChannels();
     Karma      = MyJodel.GetKarma();
     JodelPosts = MyJodel.GetPostLocationCombo(stickies: true);
 }
Esempio n. 4
0
        public JodelMainData GetPostChannelCombo(string channel, bool home = false)
        {
            string jsonString = Links.GetChannelCombo.ExecuteRequest(Account, new Dictionary <string, string>
            {
                { "channel", channel },
                { "home", home.ToString().ToLower() }
            });

            JsonJodelsFirstRound.RootObject jodels = JsonConvert.DeserializeObject <JsonJodelsFirstRound.RootObject>(jsonString);
            JodelMainData data = new JodelMainData {
                Max = jodels.max
            };

            data.RecentJodels.AddRange(jodels.recent.Select(r => new JodelPost(r)));
            data.RepliedJodels.AddRange(jodels.replied.Select(r => new JodelPost(r)));
            data.VotedJodels.AddRange(jodels.voted.Select(v => new JodelPost(v)));
            return(data);
        }
Esempio n. 5
0
        public JodelMainData GetPostLocationCombo(bool stickies = false, bool home = false)
        {
            string jsonString = Links.GetPostsCombo.ExecuteRequest(Account, new Dictionary <string, string>
            {
                { "lat", Account.Place.Latitude.ToString("F", CultureInfo.InvariantCulture) },
                { "lng", Account.Place.Longitude.ToString("F", CultureInfo.InvariantCulture) },
                { "stickies", stickies.ToString().ToLower() },
                { "home", home.ToString().ToLower() }
            });

            JsonJodelsFirstRound.RootObject jodels = JsonConvert.DeserializeObject <JsonJodelsFirstRound.RootObject>(jsonString);
            JodelMainData data = new JodelMainData {
                Max = jodels.max
            };

            data.RecentJodels.AddRange(jodels.recent.Select(r => new JodelPost(r)));
            data.RepliedJodels.AddRange(jodels.replied.Select(r => new JodelPost(r)));
            data.VotedJodels.AddRange(jodels.voted.Select(v => new JodelPost(v)));
            return(data);
        }