private InstagramData processData(List <string> l, List <string> c, List <string> cc,
                                          List <string> ccc, List <string> p, List <string> m)
        {
            JSONReader    reader = new JSONReader();
            InstagramData temp   = new InstagramData();
            Media         pics   = null;

            if (l.Count() == 1 && c.Count() == 1 && cc.Count() == 1 && ccc.Count() == 1 && p.Count() == 1)
            {
                temp.user     = (reader.getProfile(File.ReadAllText(p[0])));
                temp.logins   = (reader.praseLoginHistory(File.ReadAllText(l[0])));
                temp.comments = (reader.praseCommentHistory(File.ReadAllText(c[0])));
                temp.contacts = (reader.praseContacts(File.ReadAllText(ccc[0])));
                temp.follows  = (reader.praseConnections(File.ReadAllText(cc[0])));
            }

            foreach (string item in m)
            {
                if (pics != null)
                {
                    pics.joinData(reader.praseMedia(File.ReadAllText(item)));
                }
                else
                {
                    pics = reader.praseMedia(File.ReadAllText(item));
                }
            }
            temp.pics = pics;
            return(temp);
        }
Exemple #2
0
        private InstagramData lookForData()
        {
            List <string> logins      = new List <string>();
            List <string> comments    = new List <string>();
            List <string> connections = new List <string>();
            List <string> contacts    = new List <string>();
            List <string> profile     = new List <string>();
            List <string> media       = new List <string>();
            List <string> likes       = new List <string>();
            List <string> saved       = new List <string>();
            List <string> search      = new List <string>();
            List <string> msgs        = new List <string>();

            foreach (string item in paths)
            {
                logins.AddRange(Directory.GetFiles(item, "*account_history.json", SearchOption.AllDirectories));
                connections.AddRange(Directory.GetFiles(item, "*connections.json", SearchOption.AllDirectories));
                contacts.AddRange(Directory.GetFiles(item, "*contacts.json", SearchOption.AllDirectories));
                profile.AddRange(Directory.GetFiles(item, "*profile.json", SearchOption.AllDirectories));
                media.AddRange(Directory.GetFiles(item, "*media.json", SearchOption.AllDirectories));
                comments.AddRange(Directory.GetFiles(item, "*comments.json", SearchOption.AllDirectories));
                likes.AddRange(Directory.GetFiles(item, "*likes.json", SearchOption.AllDirectories));
                saved.AddRange(Directory.GetFiles(item, "*saved.json", SearchOption.AllDirectories));
                search.AddRange(Directory.GetFiles(item, "*searches.json", SearchOption.AllDirectories));
                msgs.AddRange(Directory.GetFiles(item, "*messages.json", SearchOption.AllDirectories));
            }

            JSONReader    reader = new JSONReader();
            InstagramData temp   = new InstagramData();
            Media         pics   = null;

            if (logins.Count() == 1 && comments.Count() == 1 && connections.Count() == 1 && contacts.Count() == 1 && profile.Count() == 1 && likes.Count() == 1)
            {
                temp.user     = (reader.getProfile(File.ReadAllText(profile[0])));
                temp.logins   = (reader.praseLoginHistory(File.ReadAllText(logins[0])));
                temp.comments = (reader.praseCommentHistory(File.ReadAllText(comments[0])));
                temp.contacts = (reader.praseContacts(File.ReadAllText(contacts[0])));
                temp.follows  = (reader.praseConnections(File.ReadAllText(connections[0])));
                temp.likes    = (reader.praseLikes(File.ReadAllText(likes[0])));
                temp.saved    = (reader.praseSaved(File.ReadAllText(saved[0])));
                temp.search   = (reader.praseSearch(File.ReadAllText(search[0])));
                temp.msgs     = (reader.praseMessages(File.ReadAllText(msgs[0])));
            }

            foreach (string item in media)
            {
                if (pics != null)
                {
                    pics.joinData(reader.praseMedia(File.ReadAllText(item)));
                }
                else
                {
                    pics = reader.praseMedia(File.ReadAllText(item));
                }
            }
            temp.pics   = pics;
            temp.pathes = paths;
            return(temp);
        }
Exemple #3
0
 public void Show(InstagramData data)
 {
     this.prasedData = data;
     Show();
 }