Exemplo n.º 1
0
        public ObservableCollection <TwitterTrend> CollectTrend(IPlaceTrends trends)
        {
            TrendCollection collection = new TrendCollection();

            foreach (var tr in trends.Trends.ToList())
            {
                TwitterTrend t = new TwitterTrend
                {
                    Name            = tr.Name,
                    URL             = tr.URL,
                    Query           = tr.Query,
                    PromotedContent = tr.PromotedContent,
                    TweetVolume     = tr.TweetVolume,
                };
                collection.Add(t);
            }
            return(collection);
        }
Exemplo n.º 2
0
        public TrendCollection GetTrends()
        {
            var toReturn = new TrendCollection();

            // TODO: Lopp this up?
            var trend = new Trend()
            {
                Tag   = 925,
                Value = Status.active_power.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };

            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 926,
                Value = Status.max_level.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 162,
                Value = Status.voltage.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 1000,
                Value = Status.current.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 1006,
                Value = Status.peak_current.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 720,
                Value = Status.ic_temperature.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 502,
                Value = Status.peak_ic_temperature.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 392,
                Value = Status.humidity.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 717,
                Value = Status.external_temperature.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            trend = new Trend()
            {
                Tag   = 959,
                Value = Status.uptime.ToString(),
                Time  = 1456198800 // TODO: Convert Timestamp to this number format
            };
            toReturn.RealTimeChannels.Add(trend);

            return(toReturn);
        }