BACK to Gallery


Challenge Requirements:

  1. Crawl / retrieve images data in each and every pages from Gallery. (90+ pages, hint: work smart!)

  2. Allow input / output result in correct JSON format. (Refer JSON sample below)

  3. Develop working RESTful API call. (Choose appropriate Restful method for each API)

  4. Host your API on a production server. (Your API need to be publicly accessible)

  5. Create a html page to feature Popular (1) & Most Viewed (10) images (UI/UX matters)

  6. Manage and commit your code via AG GitLab. https://gitlab.agsmartit.com/

  7. Refer your job application, complete this challenge with the most relevant technology. (PHP / C# .NET)


Given the data on the main page, develop API call that return the image data (id, name, url, page, requestCount) for the following functions:

  1. Get all images data (eg. http://myapi.com/meme/all)
        #sample output
        [
            {
                "id" : 1,
                "name" : "10 seconds later",
                "url" : "https://images.funplay8.com/test/10_seconds_later.jpg",
                "page" : 1,
                "requestCount" : 0
            },
            ...
            {
                "id" : 852,
                "name" : "youre the man",
                "url" : "https://images.funplay8.com/test/youre_the_man.jpg",
                "page" : 95,
                "requestCount" : 0
            }
        ]
    					
  2. Get image data based on id (eg. http://myapi.com/meme/id/1)
        #sample output
        {
            "id" : 1,
            "name" : "10 seconds later",
            "url" : "https://images.funplay8.com/test/10_seconds_later.jpg",
            "page" : 1,
            "requestCount" : 1
        }
    					
  3. Get image data based on page (eg. http://myapi.com/meme/page/2)
        #sample output
        [
            {
                "id" : 10,
                "name" : "3 days later",
                "url" : "https://images.funplay8.com/test/3_days_later.jpg",
                "page" : 2,
                "requestCount" : 2
            },
            ...
            {
                "id" : 18,
                "name" : "5 minutes later",
                "url" : "https://images.funplay8.com/test/5_minutes_later.jpg",
                "page" : 2,
                "requestCount" : 2
            }
        ]
    					
  4. Get the most popular image (eg. http://myapi.com/meme/popular).
        #sample output
        [
            {
                "id" : 1,
                "name" : "10 seconds later",
                "url" : "https://images.funplay8.com/test/10_seconds_later.jpg",
                "page" : 1,
                "requestCount" : 81
            }
        ]
    
    					
  5. Allow user to insert new image data (eg. http://myapi.com/meme/create).
    Your function should auto assign id and page to the image data.
        #sample input
        "data":
        [
            {
                "name" : "My best selfie",
                "url" : "https://any.image.com/url/my_best_selfie.jpg"
            },
            ...
            {
                "name" : "I like my job",
                "url" : "https://any.image.com/url/i_like_my_job.jpg"
            }
        ]