1. Most Active Authors Python 3 • Autocomplete Ready O ow apps 1 > "!/bin/python3 - In this challenge, the REST API contains information about a collection of users and articles they created. Given the 10 threshold value, the goal is to use the API to get the list of most active authors. Specifically, the list of usernames of users with submission count strictly greater than the given threshold. The list of usernames must be retumed in the order the users appear in the results. 11 * Complete the 'getUsernames' function below. 12 13 " The function is expected to return a STRING ARRAY. # The function accepts INTEGER threshold as 14 To access the collection of users perform HTTP GET request to: https://jsonmock.hackerrank.com/api/article_users?page= where is an integer denoting the page of the results to return. 15 parameter. 16 For example, GET request to: * URL for cut and paste * https://jsonmock.hackerrank.com/api/ 17 https://jsonmock.hackerrank.com/api/article_users/search?page=2 will return the second page of the collection af users. Pages are numbered from 1, so in order to access the first page, you need to ask for page number 1. 18 article_users?page= 19 20 The response to such request is a JSON with the following 5 fields: def getusernames (threshold): a write your code here 21 22 23 • page: The current page of the results • per_page: The maximum number of users returned per page. • total: The total number of users on all pages of the result. • total_pages: The total number of pages with results. • data: An array of objects containing users returned on the requested page 24 > if name =='main':- Each user record has the following schema: • id: unique ID of the user • username: the username of the user • about: the about information of the user • submitted: total number of articles submitted by the user • updated_at: the date and time of the last update to this record • submission_count: the number of submitted articles that are approved • comment_count: the total number of comments the user made • created_at: the date and time when the record was created

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Please use python3 to solve this question.

Begin with def getUsernames(threshold):

1. Most Active Authors
Python 3
Autocomplete Ready O
Show apps
1 > #!/bin/python3 -
In this challenge, the REST API contains information about a collection of users and articles they created. Given the
threshold value, the goal is to use the API to get the list of most active authors. Specifically, the list of usernames of
users with submission count strictly greater than the given threshold. The list of usernames must be retumed in the
order the users appear in the results.
10
11
12
# Complete the 'getUsernames' function below.
13
%23
# The function is expected to return a
STRING ARRAY.
# The function accepts INTEGER threshold as
14
To access the collection of users perform HTTP GET request to:
https://jsonmock.hackerrank.com/api/article_users?page=<pageNumber>
15
where <pageNumber> is an integer denoting the page of the results to return.
parameter.
16
23
For example, GET request to:
17
# URL for cut and paste
https://jsonmock.hackerrank.com/api/article_users/search?page=2
18
# https://jsonmock.hackerrank.com/api/
will return the second page of the collection af users. Pages are numbered from 1, so in order to access the first page,
you need to ask for page number 1.
article_users?page=<pageNumber>
19
20
The response to such request is a JSON with the following 5 fields:
def getusernames (threshold):
# write your code here
21
22
23
page: The current page of the results
• per_page: The maximum number of users returned per page.
• total: The total number of users on all pages of the result.
• total_pages: The total number of pages with results.
• data: An array of objects containing users returned on the requested page
24 > if
-_name_
_main__': -
==
Each user record has the following schema:
• id: unique ID of the user
• username: the username of the user
• about: the about information of the user
• submitted: total number of articles submitted by the user
• updated_at: the date and time of the last update to this record
• submission_count: the number of submitted articles that are approved
• comment_count: the total number of comments the user made
• created_at: the date and time when the record was created
::
Transcribed Image Text:1. Most Active Authors Python 3 Autocomplete Ready O Show apps 1 > #!/bin/python3 - In this challenge, the REST API contains information about a collection of users and articles they created. Given the threshold value, the goal is to use the API to get the list of most active authors. Specifically, the list of usernames of users with submission count strictly greater than the given threshold. The list of usernames must be retumed in the order the users appear in the results. 10 11 12 # Complete the 'getUsernames' function below. 13 %23 # The function is expected to return a STRING ARRAY. # The function accepts INTEGER threshold as 14 To access the collection of users perform HTTP GET request to: https://jsonmock.hackerrank.com/api/article_users?page=<pageNumber> 15 where <pageNumber> is an integer denoting the page of the results to return. parameter. 16 23 For example, GET request to: 17 # URL for cut and paste https://jsonmock.hackerrank.com/api/article_users/search?page=2 18 # https://jsonmock.hackerrank.com/api/ will return the second page of the collection af users. Pages are numbered from 1, so in order to access the first page, you need to ask for page number 1. article_users?page=<pageNumber> 19 20 The response to such request is a JSON with the following 5 fields: def getusernames (threshold): # write your code here 21 22 23 page: The current page of the results • per_page: The maximum number of users returned per page. • total: The total number of users on all pages of the result. • total_pages: The total number of pages with results. • data: An array of objects containing users returned on the requested page 24 > if -_name_ _main__': - == Each user record has the following schema: • id: unique ID of the user • username: the username of the user • about: the about information of the user • submitted: total number of articles submitted by the user • updated_at: the date and time of the last update to this record • submission_count: the number of submitted articles that are approved • comment_count: the total number of comments the user made • created_at: the date and time when the record was created ::
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT