static void Main(string[] args) { FeedClient<FeedEntry> newsClient = new FeedClient<FeedEntry>( Endpoints.NewsBaseUrl); ActionClient<ActionAlert> actionClient = new ActionClient<ActionAlert>( Endpoints.ActionAlertsUrl); var client = new LiveBernieClient(newsClient, actionClient); Console.WriteLine("NEWSFEED"); Console.WriteLine("====================================="); var news = client.GetNewsAsync().Result; var alerts = client.GetActionsAsync().Result; for (int i = 0; i < news.Count; i++) { var entry = news[i]; Console.WriteLine(i + ": " + entry.Id + " " + entry.Title); } Console.WriteLine("ACTION ALERTS"); Console.WriteLine("====================================="); for (int i = 0; i < alerts.Count; i++) { var entry = alerts[i]; Console.WriteLine(i + ": " + entry.Id + " " + entry.Title + " " + entry.ShortDescription); } Console.ReadLine(); }
static void Main(string[] args) { FeedClient <FeedEntry> newsClient = new FeedClient <FeedEntry>( Endpoints.NewsBaseUrl); ActionClient <ActionAlert> actionClient = new ActionClient <ActionAlert>( Endpoints.ActionAlertsUrl); var client = new LiveBernieClient(newsClient, actionClient); Console.WriteLine("NEWSFEED"); Console.WriteLine("====================================="); var news = client.GetNewsAsync().Result; var alerts = client.GetActionsAsync().Result; for (int i = 0; i < news.Count; i++) { var entry = news[i]; Console.WriteLine(i + ": " + entry.Id + " " + entry.Title); } Console.WriteLine("ACTION ALERTS"); Console.WriteLine("====================================="); for (int i = 0; i < alerts.Count; i++) { var entry = alerts[i]; Console.WriteLine(i + ": " + entry.Id + " " + entry.Title + " " + entry.ShortDescription); } Console.ReadLine(); }
public NodeService(string name, Uri endPoint, ApiTypes api, ServiceTypes serviceType) : base(name) { // Default account icon PathIcon = "M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"; EndPoint = endPoint; Api = api; ServiceType = serviceType; //Id = Guid.NewGuid().ToString(); Id = endPoint.AbsoluteUri; switch (api) { case ApiTypes.atAtomPub: Client = new AtomPubClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atXMLRPC_MovableType: Client = new XmlRpcClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atXMLRPC_WordPress: Client = new XmlRpcClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atFeed: Client = new FeedClient(); break; //TODO: WP, AtomAPI } }
public void GetAllPostByUser() { var userInfo = new User() { Email = "*****@*****.**", IsFacebookUser = false, AcceptedTerms = true, Name = "Kenji", Password = "******" }; userInfo.GuidKey = GuidGenerate.USER_ID; var userClient = new UserClient(); var apiResponse = userClient.GetByObj(userInfo); if (apiResponse.IsSuccess) { var feedClient = new FeedClient(); var feedInfo = new Feed() { GuidKey = GuidGenerate.USER_ID }; var apiResponse1 = feedClient.GetByObj(feedInfo); var lstPosts = apiResponse1.Data; } Assert.IsTrue(true); }
public async Task <DataFeedModel <ExpiringCard> > GetDataFeed() { using (var fc = new FeedClient()) { DataFeedModel <ExpiringCard> result = await fc.GetDataFeedResult <ExpiringCard>("expiring-cards"); return(result); } }
static void Main(string[] args) { if (args[0] == "PUB") { var feedPortNumber = Convert.ToInt32(args[1]); var adminPortNumber = Convert.ToInt32(args[2]); var serviceHost = new ServiceHost(feedPortNumber, adminPortNumber); serviceHost.Start(); } else if (args[0] == "SUB") { var client = new FeedClient("localhost", Convert.ToInt32(args[1]), args[2]); client.Start(); } }
public LiveBernieClient(FeedClient<FeedEntry> newsClient, ActionClient<ActionAlert> actionClient) { _newsClient = newsClient; _actionClient = actionClient; }
public LiveBernieClient(FeedClient <FeedEntry> newsClient, ActionClient <ActionAlert> actionClient) { _newsClient = newsClient; _actionClient = actionClient; }
public FeedService(FeedClient feedClient) { this._feedClient = feedClient; }