public static void Search(string ImageLink, Action<Entry> AddEntry)
        {
            var t = new BasicTinEyeSearch();

            t.AddEntry += AddEntry;

            t.Search(ImageLink);
        }
Example #2
0
        public static void Search(string ImageLink, Action <Entry> AddEntry)
        {
            var t = new BasicTinEyeSearch();

            t.AddEntry += AddEntry;

            t.Search(ImageLink);
        }
Example #3
0
        public static byte[] ToBytes(Uri uri)
        {
            var x = default(byte[]);

            BasicTinEyeSearch.Search(uri.ToString(),
                                     e =>
            {
                x = BasicWebCrawler.ToBytes(new Uri(e.QueryLink));
            }
                                     );
            return(x);
        }
        public static void Search(string Key, MemoryDirectory memory, Action <Entry, BasicTinEyeSearch.Entry, BasicPirateBayImage.Entry> AddEntry)
        {
            Search(Key,
                   imdb =>
            {
                var _tineye = default(BasicTinEyeSearch.Entry);
                var _bayimg = default(BasicPirateBayImage.Entry);

                BasicTinEyeSearch.Search(imdb.MediumPosterImage,
                                         tineye =>
                {
                    _tineye = tineye;

                    var tineye_memory = default(DirectoryInfo);
                    var bayimg_memory = default(DirectoryInfo);

                    if (memory != null)
                    {
                        tineye_memory = memory[tineye.Hash];
                        bayimg_memory = tineye_memory.FirstDirectoryOrDefault();

                        if (bayimg_memory != null)
                        {
                            _bayimg = new BasicPirateBayImage.Entry(bayimg_memory.Name);
                        }
                    }

                    if (_bayimg == null)
                    {
                        Native.API.set_time_limit(5);

                        BasicPirateBayImage.Clone(tineye.QueryLink.ToUri(),
                                                  bayimg =>
                        {
                            _bayimg = bayimg;

                            if (tineye_memory != null)
                            {
                                bayimg_memory = tineye_memory.CreateSubdirectory(bayimg.Key);
                            }
                        }
                                                  );
                    }
                }
                                         );

                AddEntry(imdb, _tineye, _bayimg);
            }
                   );
        }