{"id":13694268,"url":"https://github.com/liu044100/SmileWeather","last_synced_at":"2025-05-03T01:32:10.331Z","repository":{"id":35452488,"uuid":"39719610","full_name":"liu044100/SmileWeather","owner":"liu044100","description":"A library for Search \u0026 Parse the weather data from Wunderground \u0026 Openweathermap conveniently.","archived":false,"fork":false,"pushed_at":"2017-05-14T03:14:09.000Z","size":16283,"stargazers_count":484,"open_issues_count":0,"forks_count":86,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-02T10:15:55.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/liu044100.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}},"created_at":"2015-07-26T08:57:07.000Z","updated_at":"2023-12-18T18:32:09.000Z","dependencies_parsed_at":"2022-09-24T09:01:30.214Z","dependency_job_id":null,"html_url":"https://github.com/liu044100/SmileWeather","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liu044100%2FSmileWeather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liu044100%2FSmileWeather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liu044100%2FSmileWeather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liu044100%2FSmileWeather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liu044100","download_url":"https://codeload.github.com/liu044100/SmileWeather/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224346436,"owners_count":17296215,"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-08-02T17:01:28.268Z","updated_at":"2024-11-12T20:31:52.810Z","avatar_url":"https://github.com/liu044100.png","language":"Objective-C","funding_links":[],"categories":["Weather"],"sub_categories":["Notes"],"readme":"# SmileWeather\n\n\u003ca href=\"https://travis-ci.org/liu044100/SmileWeather\"\u003e\u003cimg src=\"https://img.shields.io/travis/liu044100/SmileWeather/master.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/github/liu044100/SmileWeather?branch=master\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/liu044100/SmileWeather.svg\"\u003e\u003c/a\u003e\n[![GitHub Issues](http://img.shields.io/github/issues/liu044100/SmileWeather.svg?style=flat)](https://github.com/liu044100/SmileWeather/issues)\n[![Version](https://img.shields.io/cocoapods/v/SmileWeather.svg?style=flat)](http://cocoadocs.org/docsets/SmileWeather)\n[![License](https://img.shields.io/cocoapods/l/SmileWeather.svg?style=flat)](http://cocoadocs.org/docsets/SmileWeather)\n[![Platform](https://img.shields.io/cocoapods/p/SmileWeather.svg?style=flat)](http://cocoadocs.org/docsets/SmileWeather)\n\nA library for Search \u0026 Parse the weather data from [Wunderground](http://www.wunderground.com) \u0026 [Openweathermap](http://openweathermap.org) conveniently.\n\n\u003c!--- [Openweathermap](http://openweathermap.org) is not stable now, recommend use [Wunderground](http://www.wunderground.com)--\u003e\n\n\u003cimg src=\"SmileWeather-Example/demo_gif/new_pro.jpg\" width=\"700\"\u003e\n\n#What can it do for you?\n\n\n##### 1. Handle all complicated things about Search \u0026 Parse the weather data.\n\nFor example, you can search place by using `-(void)getPlacemarksFromString:(NSString*)string completion:(SmileWeatherPlacemarksCompletion)completion`, the completion block return array of the `CLPlacemark`.\n\n```Objective-c\n[[SmileWeatherDownLoader sharedDownloader] getPlacemarksFromString:@\"cupertino\" completion:^(NSArray *placeMarks, NSError *error) {\n        if (!error) {\n            //search results: array of placemark in here\n        }\n    }];\n```\n\u003cimg src=\"SmileWeather-Example/demo_gif/search.png\" width=\"400\"\u003e\n\nYou can get the placemark's weather data by using `-(void)getWeatherDataFromPlacemark:(CLPlacemark*)placeMark completion:(SmileWeatherDataDownloadCompletion)completion;`, the completion block return well formed weather data [SmileWeatherData](http://cocoadocs.org/docsets/SmileWeather/0.1.4/Classes/SmileWeatherData.html).\n\n```Objective-c\n[[SmileWeatherDownLoader sharedDownloader] getWeatherDataFromPlacemark:placemark completion:^(SmileWeatherData *data, NSError *error) {\n        if (!error) {\n            //Well formed weather data in here.\n        }\n    }];\n```\n\n\n##### 2. Need not any weather icon, SmileWeather handle it for you. \n\nBy using [climacons font](http://adamwhitcroft.com/climacons/), the [SmileWeatherData](http://cocoadocs.org/docsets/SmileWeather/0.1.4/Classes/SmileWeatherData.html) contains the corresponding character that is used for weather icon.\n\n```Objective-c\nSmileWeatherData *data = ...;\nUILabel *iconLabel = ...;\n\n//current weather condition\niconLabel.text = data.currentData.icon;\n```\n\u003cimg src=\"SmileWeather-Example/demo_gif/climacons.png\" width=\"500\"\u003e\n\n##### 3. Fully localized the related information for almost all the countries in the world.\n\nThe weather information, timestamp, weekday, timezone, etc, localized all the related information as much as possible.\n\n![](https://raw.githubusercontent.com/liu044100/SmileWeather/master/SmileWeather-Example/demo_gif/localization.png)\n\n##### 4. Support Today Extension \u0026 WatchOS 2.\n\n\u003cimg src=\"SmileWeather-Example/demo_gif/demo_extension.png\" width=\"400\"\u003e\n\u003cimg src=\"SmileWeather-Example/demo_gif/watch.PNG\" width=\"300\"\u003e\n\n##### 5. Add the Weather Widget Style UI to your project simply, by using `SmileWeatherDemoVC`.\n\nPlease check the [example project](https://github.com/liu044100/SmileWeather/tree/master/SmileWeather-Example) for more detail. \n\n```Objective-c\nSmileWeatherDemoVC *demoVC = [SmileWeatherDemoVC DemoVCToView:self.containerView];\n```\n\u003cimg src=\"SmileWeather-Example/demo_gif/demoview.png\" width=\"500\"\u003e\n\n#Theoretical Introduction\n\nThe main class is the [SmileWeatherDownLoader](http://cocoadocs.org/docsets/SmileWeather/0.1.4/Classes/SmileWeatherDownLoader.html). It handle downloading weather data from the [Wunderground](http://www.wunderground.com) server. It has three main method:\n\n```Objective-c\n/*!Get weather data from CLPlacemark.*/\n-(void)getWeatherDataFromPlacemark:(CLPlacemark*)placeMark completion:(SmileWeatherDataDownloadCompletion)completion;\n\n/*!Get weather data from CLLocation.*/\n-(void)getWeatherDataFromLocation:(CLLocation*)location completion:(SmileWeatherDataDownloadCompletion)completion;\n\n/*!Get array of CLPlacemark from the input string.*/\n-(void)getPlacemarksFromString:(NSString*)string completion:(SmileWeatherPlacemarksCompletion)completion;\n```\n\nIn the `SmileWeatherDataDownloadCompletion` block, [SmileWeatherData](http://cocoadocs.org/docsets/SmileWeather/0.1.4/Classes/SmileWeatherData.html) is returned, it contains the current weather data, 4 days forecast data, 24 hourly forecast data, etc. \n\n```Objective-c\n[[SmileWeatherDownLoader sharedDownloader] getWeatherDataFromPlacemark:placemark completion:^(SmileWeatherData *data, NSError *error) {\n        if (!error) {\n            NSLog(@\"Current Temperature, Celsius : %@, Fahrenheit: %@\", data.currentData.currentTempStri_Celsius, data.currentData.currentTempStri_Fahrenheit);\n        }\n    }];\n```\n\n[SmileWeatherData](http://cocoadocs.org/docsets/SmileWeather/0.1.4/Classes/SmileWeatherData.html) also conform to `NSCoding`, you can archive it as `NSData`.\n\n```Objective-c\nSmileWeatherData *data = ...\nNSData* encodedData = [NSKeyedArchiver archivedDataWithRootObject: data];\n```\n\n#How to use it for your project?\n\n**Step 1.** SmileWeather is available through use [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```Ruby\npod 'SmileWeather'\n\n```\nOr you can drag the `SmileWeather` folder to your project.\n\n**Step 2.** Sign up [Wunderground](http://www.wunderground.com/weather/api) or [Openweathermap](http://openweathermap.org/api) to get the api key.\n\n**Step 3.** Follow as the below image, add the api key and [climacons font](http://adamwhitcroft.com/climacons/) to your project's `Info.plist`. \n\n\u003cimg src=\"SmileWeather-Example/demo_gif/step1.png\" width=\"600\"\u003e\n\nIf you use [Wunderground](http://www.wunderground.com/weather/api) api, please add this key: `API_KEY_wunderground` .\n\nIf you use [Openweathermap](http://openweathermap.org/api) api, please add this key: `API_KEY_openweathermap`.\n\nIf you add both of these in `Info.plist`, please add `API_NOW` to let the `SmileWeather` know which one should be used, `0` is `API_KEY_wunderground`, and `1` is `API_KEY_openweathermap`.\n\n\n**Step 4.** The last step is that import `SmileWeatherDownLoader.h` to your project, and use it :)\n\n\n# Contributions\n\n* Warmly welcome to submit a pull request.\n\n# Contact\n\n* If you have some advice or find some issue, please contact me.\n* Email [me](liu044100@gmail.com)\n\n# Thanks\n\nThanks for Comyar Zaheri's [Sol° for iOS](https://github.com/comyarzaheri/Sol), I am inspired by this project.\n\nThanks for [climacons font](http://adamwhitcroft.com/climacons/).\n\n# License\n\nSmileWeather is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliu044100%2FSmileWeather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliu044100%2FSmileWeather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliu044100%2FSmileWeather/lists"}