forked from MapComplete/MapComplete
		
	Velopark: first decent, working version
This commit is contained in:
		
							parent
							
								
									890816d2dd
								
							
						
					
					
						commit
						5b6cd1d2ae
					
				
					 18 changed files with 7054 additions and 21769 deletions
				
			
		
							
								
								
									
										22
									
								
								scripts/downloadLinkedDataList.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								scripts/downloadLinkedDataList.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| import Script from "./Script" | ||||
| import LinkedDataLoader from "../src/Logic/Web/LinkedDataLoader" | ||||
| import { writeFileSync } from "fs" | ||||
| 
 | ||||
| export default class DownloadLinkedDataList extends Script { | ||||
|     constructor() { | ||||
|         super("Downloads the localBusinesses from the given location. Usage: url [--no-proxy]") | ||||
|     } | ||||
| 
 | ||||
|     async main([url, noProxy]: string[]): Promise<void> { | ||||
|         const useProxy = noProxy !== "--no-proxy" | ||||
|         const data = await LinkedDataLoader.fetchJsonLd(url, {}, useProxy) | ||||
|         const path = "linked_data_"+url.replace(/[^a-zA-Z0-9_]/g, "_")+".jsonld" | ||||
|         writeFileSync(path, | ||||
|             JSON.stringify(data), | ||||
|             "utf8" | ||||
|             ) | ||||
|         console.log("Written",path) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| new DownloadLinkedDataList().run() | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue