Пример #1
0
    protected void btnLatestTweet_Click(object sender, EventArgs e)
    {
        string          user       = "******";
        GetUsersFriends getFriends = new GetUsersFriends();
        List <string>   friends    = new List <string>();

        friends = getFriends.getUserFriends(user);
        var    rawTweets   = Timeline.GetHomeTimeline();
        string latestTweet = "";

        for (int i = 0; i < rawTweets.Count(); i++)
        {
            if (!tweets.Contains(rawTweets.ElementAt(i).ToString()))
            {
                tweets.Add(rawTweets.ElementAt(i).ToString());
            }
        }
        for (int i = 0; i < tweets.Count; i++)
        {
            if (tweets[i].Contains(txtHashTag.Text))
            {
                latestTweet = tweets[i].ToString();
                break;
            }
        }
        sp.SpeakAsync(latestTweet.ToString());
        readTweets.Add(latestTweet.ToString());
    }
Пример #2
0
    protected void btnVoice_Click(object sender, EventArgs e)
    {
        string          user       = "******";
        GetUsersFriends getFriends = new GetUsersFriends();
        List <string>   friends    = new List <string>();

        friends = getFriends.getUserFriends(user);
        var rawTweets = Timeline.GetHomeTimeline();

        for (int i = 0; i < rawTweets.Count(); i++)
        {
            if (!tweets.Contains(rawTweets.ElementAt(i).ToString()))
            {
                tweets.Add(rawTweets.ElementAt(i).ToString());
            }
        }

        if (newPosts())
        {
            chirp();
        }
    }