Ejemplo n.º 1
0
        /// <summary>
        /// Get the main page images converted to JSON, given a page offset
        /// </summary>
        /// <param name="pageoffset">
        /// <param name="">
        /// <returns>
        /// The JSON object from the API.
        /// </returns>
        public static JObject GetMainpageImages(int pageoffset)
        {
            string response =
                DB.MLC.MakeGetRequest(DB.TodayImages, new Dictionary <string, string>()
            {
                { "page", pageoffset.ToString() }
            }).Content;

            return(APIs.StringToJObject(response));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method performs a search on the DB api and return the result.
        /// </summary>
        /// <param name="strquery">The query string</param>
        /// <returns></returns>
        public static JObject SearchDB(string strquery, int page = 1, int perpage = 50)
        {
            var parameters = new Dictionary <string, string>()
            {
                { "page", page.ToString() },
                { "perpage", perpage.ToString() },
                { "q", strquery }
            };
            string response =
                MLC.MakeGetRequest(DB.SearchEndpoint, parameters, URLENCODEMODE.UnicodeURL).Content;

            return(APIs.StringToJObject(response));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets today's images from derpibooru, the end point targeted is:
        /// https://derpibooru.org/images.json
        /// </summary>
        /// <returns>
        /// The object representing the Json.
        /// </returns>
        public static JObject GetTodayImages()
        {
            string response = MLC.MakeGetRequest(TodayImages).Content;

            return(APIs.StringToJObject(response));
        }