{"id":21311457,"url":"https://github.com/electricbubble/colorful-clouds-api","last_synced_at":"2025-03-15T20:42:40.057Z","repository":{"id":114511398,"uuid":"329635386","full_name":"electricbubble/colorful-clouds-api","owner":"electricbubble","description":"彩云天气 API (个人用户)","archived":false,"fork":false,"pushed_at":"2021-01-14T14:15:18.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T09:46:11.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electricbubble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-14T14:14:12.000Z","updated_at":"2023-06-05T03:06:53.000Z","dependencies_parsed_at":"2023-08-21T14:01:29.011Z","dependency_job_id":null,"html_url":"https://github.com/electricbubble/colorful-clouds-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electricbubble%2Fcolorful-clouds-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electricbubble%2Fcolorful-clouds-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electricbubble%2Fcolorful-clouds-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electricbubble%2Fcolorful-clouds-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electricbubble","download_url":"https://codeload.github.com/electricbubble/colorful-clouds-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790945,"owners_count":20348378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T17:18:29.558Z","updated_at":"2025-03-15T20:42:40.031Z","avatar_url":"https://github.com/electricbubble.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ColorfulClouds API\n\n[彩云天气 API](https://open.caiyunapp.com/%E5%BD%A9%E4%BA%91%E5%A4%A9%E6%B0%94_API_%E4%B8%80%E8%A7%88%E8%A1%A8)\n\u003e 个人用户, `2个` 可用接口\n\u003e - 实况天气\n\u003e - 通用预报\n\n## Installation\n\n```shell\ngo get github.com/electricbubble/colorful-clouds-api\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\tcaiYunApi \"github.com/electricbubble/colorful-clouds-api\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tcyToken := os.Getenv(\"Token\")\n\tcyLongitudeAndLatitude := os.Getenv(\"LongitudeAndLatitude\")\n\tcyAPi := caiYunApi.NewColorfulCloudsApi(cyToken, cyLongitudeAndLatitude)\n\n\trealtime, err := cyAPi.Realtime()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tbuffer := bytes.NewBufferString(\"🌈天气预报员\\n\")\n\tbuffer.WriteString(fmt.Sprintf(\"当前温度: %.0f˚\\n\", realtime.Result.Realtime.Temperature))\n\tbuffer.WriteString(fmt.Sprintf(\"体感温度: %.0f˚\\n\", realtime.Result.Realtime.ApparentTemperature))\n\t// buffer.WriteString(fmt.Sprintf(\"主要天气现象: %s\\n\", realtime.Result.Realtime.Skycon))\n\tbuffer.WriteString(fmt.Sprintf(\"能见度: %.1fkm\\n\", realtime.Result.Realtime.Visibility))\n\tbuffer.WriteString(fmt.Sprintf(\"风速: %.1fkm/hr\\n\", realtime.Result.Realtime.Wind.Speed))\n\tbuffer.WriteString(fmt.Sprintf(\"空气质量: %s\\n\", realtime.Result.Realtime.AirQuality.Description.Chn))\n\tbuffer.WriteString(fmt.Sprintf(\"紫外线指数: %s\\n\", realtime.Result.Realtime.LifeIndex.Ultraviolet.Desc))\n\tbuffer.WriteString(fmt.Sprintf(\"舒适度指数: %s\\n\", realtime.Result.Realtime.LifeIndex.Comfort.Desc))\n\n\tweather, err := cyAPi.Weather(caiYunApi.Alert(true), caiYunApi.DailySteps(1), caiYunApi.HourlySteps(24))\n\tif err == nil {\n\t\tbuffer.WriteString(weather.Result.ForecastKeypoint + \"\\n\")\n\t\tastro := weather.Result.Daily.Astro\n\t\tif len(astro) \u003e 0 {\n\t\t\tbuffer.WriteString(fmt.Sprintf(\"日出时间: %s\\n\", astro[0].Sunrise))\n\t\t\tbuffer.WriteString(fmt.Sprintf(\"日落时间: %s\\n\", astro[0].Sunset))\n\t\t}\n\t}\n\n\tfmt.Println(buffer.String())\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectricbubble%2Fcolorful-clouds-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectricbubble%2Fcolorful-clouds-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectricbubble%2Fcolorful-clouds-api/lists"}