예제 #1
0
        /// <summary>
        /// Gets the thread.
        /// </summary>
        /// <returns>The thread.</returns>
        /// <param name="board">Boad.</param>
        /// <param name="threadNumber">Thread number.</param>
        public static Thread GetThread(string board, int threadNumber)
        {
            Thread thread = HTTPUtil.DownloadObject <Thread>(Constants.GetThreadUrl(board, threadNumber));

            if (thread != null)
            {
                foreach (Post item in thread.Posts)
                {
                    item.Board = board;
                }
            }
            return(thread);
        }
예제 #2
0
        /// <summary>
        /// Gets thead root object.
        /// </summary>
        /// <returns>The thread page.</returns>
        /// <param name="board">Board.</param>
        /// <param name="page">Page.</param>
        public static ThreadRootObject GetThreadPage(string board, int page)
        {
            ThreadRootObject thread = HTTPUtil.DownloadObject <ThreadRootObject>(Constants.GetThreadPageUrl(board, page));

            if (thread != null)
            {
                foreach (Thread item in thread.Threads)
                {
                    foreach (Post post in item.Posts)
                    {
                        post.Board = board;
                    }
                }
            }
            return(thread);
        }
예제 #3
0
 /// <summary>
 /// Gets boards info.
 /// </summary>
 /// <returns>The board.</returns>
 public static BoardRootObject GetBoard()
 {
     return(HTTPUtil.DownloadObject <BoardRootObject>(Constants.BoardsUrl));
 }
예제 #4
0
 public static List <Page> GetPagesFromBoard(string board)
 {
     return(HTTPUtil.DownloadObject <List <Page> >(Constants.GetThreadsUrl(board)));
 }