File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from fastapi .responses import JSONResponse
1010from pydantic import BaseModel , HttpUrl
1111
12+ import oshminer .supported_domains
1213class Item (BaseModel ):
1314 name : str
1415 description : Optional [str ] = None
@@ -19,13 +20,6 @@ class MiningRequest(BaseModel):
1920 repo_urls : Set [HttpUrl ] = set ()
2021 requested_data : Set [str ] = set ()
2122
22- # Supported hosting platforms as a list of their domains.
23- # `repo_urls` need to include one of these domains.
24- supported_domains : list = [
25- "github.com" ,
26- "wikifactory.com"
27- ]
28-
2923# Supported data-mining request types. Items in `required_data` must
3024# be from this list.
3125supported_data_requests : list = [
@@ -145,4 +139,25 @@ async def mining_request(request_body: MiningRequest):
145139 else :
146140 repo_dict ["requested_data" ][data_item ] = ""
147141 response .append (repo_dict )
148- return response
142+ return response
143+
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+ """
155+ 1. get `list` of requested info
156+ 2. compile API request
157+ 2.1 get needed API requests for each item in `list`
158+ 2.2 deduplicate into list of what's needed from API
159+ 2.3 create API call
160+ 2.4 make API call
161+ 3. interpret and derive info from API response
162+ 4. send our own response
163+ """
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # -*- coding: utf-8 -*-
3+ # SPDX-FileCopyrightText: 2022 Pen-Yuan Hsing
4+ # SPDX-License-Identifier: AGPL-3.0-or-later
5+
6+ # Supported hosting platforms as a list of their domains.
7+ # `repo_urls` need to include one of these domains.
8+ supported_domains : list = [
9+ "github.com" ,
10+ "wikifactory.com"
11+ ]
You can’t perform that action at this time.
0 commit comments