{ "copyright": "\nDavid Moulton\n", "date": "2024-03-05", "explanation": "Is this a painting or a photograph? In this celestial abstract art composed with a cosmic brush, dusty nebula NGC 2170, also known as the Angel Nebula, shines just above the image center. Reflecting the light of nearby hot stars, NGC 2170 is joined by other bluish reflection nebulae, a red emission region, many dark absorption nebulae, and a backdrop of colorful stars. Like the common household items that abstract painters often choose for their subjects, the clouds of gas, dust, and hot stars featured here are also commonly found in a setting like this one -- a massive, star-forming molecular cloud in the constellation of the Unicorn (Monoceros). The giant molecular cloud, Mon R2, is impressively close, estimated to be only 2,400 light-years or so away. At that distance, this canvas would be over 60 light-years across.", "hdurl": "https://apod.nasa.gov/apod/image/2403/AngelNebula_Moulton_2516.jpg", "media_type": "image", "service_version": "v1", "title": "NGC 2170: Angel Nebula Abstract Art", "url": "https://apod.nasa.gov/apod/image/2403/AngelNebula_Moulton_960.jpg" }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2024/3/5 11:11 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://api.nasa.gov/planetary/apod?api_key=key'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://api.nasa.gov/planetary/apod?api_key=key" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }