Upgrading Dependencies and start restructure
This commit is contained in:
parent
44a80d76a9
commit
e97ebf86ef
5 changed files with 54 additions and 78 deletions
|
@ -1,38 +0,0 @@
|
|||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Geekbot.net.Lib.Dtos.FourChanDto;
|
||||
|
||||
namespace Geekbot.net.Lib.IClients
|
||||
{
|
||||
|
||||
class FourChanBoardClient
|
||||
{
|
||||
private BoardList boards;
|
||||
private static FourChanBoardClient instace;
|
||||
|
||||
private FourChanBoardClient()
|
||||
{
|
||||
Console.WriteLine("Fetching Boards");
|
||||
var boardClient = new RestClient("https://a.4cdn.org");
|
||||
var boardRequest = new RestRequest("boards.json", Method.GET);
|
||||
var boardResult = boardClient.Execute<BoardList>(boardRequest);
|
||||
this.boards = boardResult.Data;
|
||||
}
|
||||
|
||||
public static FourChanBoardClient Boards()
|
||||
{
|
||||
if (instace == null)
|
||||
{
|
||||
instace = new FourChanBoardClient();
|
||||
}
|
||||
|
||||
return instace;
|
||||
}
|
||||
|
||||
public List<Board> getBoards()
|
||||
{
|
||||
return this.boards.Boards;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue