From b6335e3646843b937e249ef9ee98cafee8585cea Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Fri, 17 Feb 2017 12:15:13 +0300 Subject: RetroArch pack script --- ImageGooglerForm.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'ImageGooglerForm.cs') diff --git a/ImageGooglerForm.cs b/ImageGooglerForm.cs index db1cf819..0e66503d 100644 --- a/ImageGooglerForm.cs +++ b/ImageGooglerForm.cs @@ -25,22 +25,23 @@ namespace com.clusterrr.hakchi_gui get { return result; } } - public ImageGooglerForm(string query, NesMiniApplication app) + public ImageGooglerForm(NesMiniApplication app) { InitializeComponent(); + Text = "Google Images - " + app.Name ?? ""; + searchThread = new Thread(SearchThread); + searchThread.Start(app); + } + + public static string[] GetImageUrls(NesMiniApplication app) + { + string query = app.Name ?? ""; if (app is NesGame) query += " nes|famicom box art"; else if (app is FdsGame) query += " fds box art"; else - query += " box art"; - Text = "Google Images - " + query; - searchThread = new Thread(SearchThread); - searchThread.Start(query); - } - - public static string[] GetImageUrls(string query) - { + query += " game (box|vover) art"; var url = string.Format("https://www.google.com/search?q={0}&source=lnms&tbm=isch", HttpUtility.UrlEncode(query)); Debug.WriteLine("Web request: " + url); var request = WebRequest.Create(url); @@ -80,7 +81,7 @@ namespace com.clusterrr.hakchi_gui { try { - var urls = GetImageUrls(o as string); + var urls = GetImageUrls(o as NesMiniApplication); foreach (var url in urls) { //new Thread(DownloadImageThread).Start(url); -- cgit v1.2.3