~jpgleeson/spawsh

c52729825f716d16d4b8decf59e12972bb383108 — jpgleeson 1 year, 1 month ago 09365a7
Work on search

It works but there is a loop where after fetching the search results it clears and goes back to the search page. Just an ordering thing.
1 files changed, 23 insertions(+), 7 deletions(-)

M Program.cs
M Program.cs => Program.cs +23 -7
@@ 153,14 153,10 @@ namespace spawsh
                }

                Console.WriteLine(newInput);
                if (buildRequest(newInput))
                {
                    Console.WriteLine("Fetching {0}", newInput);
                buildRequest(newInput);
                LineBuffer = fetchPage();

                    LineBuffer = fetchPage();

                    linksInPage = buildLinkSet(LineBuffer);
                }
                linksInPage = buildLinkSet(LineBuffer);

                selectedLinkIndex = -1;
            }


@@ 369,6 365,26 @@ namespace spawsh
            {
                Console.WriteLine("File not found.");
            }
            else if (responseCode == "10")
            {
                string searchPageURL = server + page;
                Console.Write("Search term: ");
                string searchParams = Console.ReadLine();

                page += "?" + searchParams;

                Console.WriteLine(page);
                Console.ReadKey();

                buildRequest(server + page);
                Console.WriteLine("Searching for {0}", searchParams);

                LineBuffer = fetchPage();
                linksInPage = buildLinkSet(LineBuffer);
                selectedLinkIndex = -1;

                Console.ReadKey();
            }
        }

    }