Skip to content

Commit

Permalink
word call works. Just need to parse JSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
lavedon committed Apr 15, 2021
1 parent 2da0386 commit 322f3c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,28 @@ public static void APICalls(CurrentQuery query)
};
// @TODO an action to set headers
// Make a new Task for each API call
var callAPI = new Task<string>( () => { Console.WriteLine("Task {0} (syncTask) executing on Thread {1}",
Task.CurrentId,
Thread.CurrentThread.ManagedThreadId);
// Reset headers before each call
resetHeaders(client);
// THIS IS FUCKED

// FUCK
return cat;
});
callAPI.RunSynchronously();


if (query.QueryMode == Modes.Word)
{
Console.WriteLine("Found that QueryMode is set to words.");
Console.WriteLine("Press Enter.");
Console.ReadLine();
Console.WriteLine("Looking up the word {0}", query.WordID);
Console.WriteLine("Press Enter.");
Console.ReadLine();
Console.WriteLine("Now to call the words endpoint.");
string APIUrl = baseURL + "words/?lemma=" + query.UserEnteredWord + "&limit=1";
string APIUrl = baseURL + "words/?lemma=" +
query.UserEnteredWord + "&limit=1";
Console.WriteLine("APIUrl is: {0}", APIUrl);
Console.WriteLine("Press Enter.");
Console.ReadLine();
resetHeaders(client);
Task getWords = new Task(callWordsAPI, "CallWords");
Console.WriteLine("Calling the API");
Console.WriteLine("Press Enter.");
Console.ReadLine();
getWords.RunSynchronously();


}
Expand Down
Binary file modified bin/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified bin/Debug/net5.0/OxfordV2.pdb
Binary file not shown.
Binary file modified obj/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified obj/Debug/net5.0/OxfordV2.pdb
Binary file not shown.

0 comments on commit 322f3c4

Please sign in to comment.