Ejemplo n.º 1
0
        static async Task Run()
        {
            // initialize computehash function
            OAuthUtility.ComputeHash = (key, buffer) => { using (var hmac = new HMACSHA1(key)) { return hmac.ComputeHash(buffer); } };

            // sample, twitter access flow
            var accessToken = await TwitterClient.AuthorizeSample(consumerKey, consumerSecret);

            var client = new TwitterClient(consumerKey, consumerSecret, accessToken);

            var tl = await client.GetTimeline(10, 1);
            Console.WriteLine(tl);
        }
Ejemplo n.º 2
0
        static async Task Run()
        {
            // initialize computehash function
            OAuthUtility.ComputeHash = (key, buffer) => { using (var hmac = new HMACSHA1(key)) { return(hmac.ComputeHash(buffer)); } };

            // sample, twitter access flow
            var accessToken = await TwitterClient.AuthorizeSample(consumerKey, consumerSecret);

            var client = new TwitterClient(consumerKey, consumerSecret, accessToken);

            var tl = await client.GetTimeline(10, 1);

            Console.WriteLine(tl);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            // initialize computehash function
            OAuthUtility.ComputeHash = (key, buffer) =>
            {
                using (var hmac = new HMACSHA1(key))
                {
                    return hmac.ComputeHash(buffer);
                }
            };

            var client = new TwitterClient(consumerKey, consumerSecret);

            // sample, twitter access flow
            client.AuthorizeSample();

            var tl = client.GetTimeline(10, 1).Result;
            Console.WriteLine(tl);

            Console.ReadKey();
        }