Exemplo n.º 1
0
        public void GetAllSnap()
        {
            var sc = new Snapchat();
            string password = Settings.Default.Password;
            bool auth = sc.Login("themysterious", password);

            foreach (Snap snap in sc.Account.Snaps)
            {
                if (snap.SentToUs && snap.Status == Enums.SnapStates.Delivered &&
                    snap.MediaType != Enums.MediaTypes.FriendRequest)
                {
                    Console.WriteLine("{0} -> {1}", snap.ScreenName, snap.RecipentName);
                    Console.WriteLine(snap.Status);
                    try
                    {
                        byte[] by = sc.GetBlob(snap.Id, "themysterious", sc.Account.AuthToken);
                        File.WriteAllBytes(snap.Id + ".jpg", by);
                    }
                    catch (Exception)
                    {
                        foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(snap))
                        {
                            string name = descriptor.Name;
                            object value = descriptor.GetValue(snap);
                            Console.WriteLine("{0}={1}", name, value);
                        }
                        throw;
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void GetSnap()
 {
     var sc = new Snapchat();
     string password = Settings.Default.Password;
     bool auth = sc.Login("themysterious", password);
     byte[] by = sc.GetBlob("555624400068219037r", "themysterious", sc.Account.AuthToken);
     File.WriteAllBytes("test.jpg", by);
 }