public FourChanAzurePipeline() : base() { Info("Initializing 4chan Azure pipeline."); Aggregator = new FourChan(); Db = new CosmosDB("socialnews"); Initialized = Aggregator.Initialized && Db.Initialized; }
public TitlingResult ThreadTopicToIrc(TitlingRequest req) { ChanPost post; switch (GetSource(req.Url)) { case Source.FourChan: post = FourChan.GetPost(req.Url); break; case Source.ArchiveMoe: post = ArchiveMoe.GetPost(req.Url); break; default: // Fail loudly for now, this might change in the future. throw new NotSupportedException("Passed TitlingRequest not supported."); } req.Resource = post; if (post.Success) { string topic = ConstructTopic(post, req.Url); if (topic == null) { req.AddMessage("Post contained neither subject or comment."); return(req.CreateResult(false)); } req.IrcTitle.SetFormat("[ /{0}/ - {1} ] [ {2} ]", post.Board, post.BoardName, topic); return(req.CreateResult(true)); } else { return(req.CreateResult(false)); } }
public FourChanTests() { aggregator = new FourChan(); }