M Program.cs => Program.cs +23 -2
@@ 181,13 181,14 @@ namespace spawsh
string[] fetchedPage = fetchPage();
LineBuffer = fetchedPage;
-
- if (LineBuffer[0] == "No such host is known.")
+
+ if (LineBuffer[0] == "No such host is known." || LineBuffer[0] == "Resource temporarily unavailable")
{
linksInPage = new string[0];
}
else
{
+ Console.WriteLine("here");
linksInPage = buildLinkSet(LineBuffer);
}
@@ 263,6 264,26 @@ namespace spawsh
static bool buildRequest(string inputString)
{
+ if (inputString.Length == 0)
+ {
+ return false;
+ }
+
+ if (inputString.Contains('\t'))
+ {
+ string[] broken = inputString.Split('\t');
+
+ inputString = broken[1];
+ }
+ else if (inputString.Contains(' '))
+ {
+ string[] broken = inputString.Split(' ');
+
+ inputString = broken[1];
+ }
+
+ Console.WriteLine("here - " + inputString);
+
if (inputString.Contains("gemini://"))
{
inputString = inputString.Trim();
M spawsh.csproj => spawsh.csproj +1 -1
@@ 2,7 2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>netcoreapp3.1</TargetFramework>
+ <TargetFramework>netcoreapp5.0</TargetFramework>
</PropertyGroup>
</Project>