Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christoph-jerolimov/afcalendarrequestoperation
AFNetworking extension for downloading and parsing calendars.
https://github.com/christoph-jerolimov/afcalendarrequestoperation
Last synced: 28 days ago
JSON representation
AFNetworking extension for downloading and parsing calendars.
- Host: GitHub
- URL: https://github.com/christoph-jerolimov/afcalendarrequestoperation
- Owner: christoph-jerolimov
- License: mit
- Created: 2013-01-22T10:52:47.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-03T21:47:24.000Z (about 11 years ago)
- Last Synced: 2024-11-25T12:16:33.672Z (28 days ago)
- Language: Objective-C
- Homepage:
- Size: 188 KB
- Stars: 24
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AFCalendarRequestOperation
AFCalendarRequestOperation is a [AFNetworking](https://github.com/AFNetworking/AFNetworking)
extension for downloading and parsing iCal calendars.## Work in process API
## Configure AFHTTPClient to use AFCalendarRequestOperation automatically
``` objective-c
AFHTTPClient* calendarClient = [[AFCalendarClient alloc] initWithBaseURL:[NSURL URLWithString:@"https://www.google.com/calendar"]];
NSURLRequest* calendarRequest = [client requestWithMethod:@"GET" path:@"ical/german__de%40holiday.calendar.google.com/public/basic.ics" parameters:nil];AFHTTPRequestOperation* calendarOperation = [calendarClient HTTPRequestOperationWithRequest:calendarRequest success:^(AFHTTPRequestOperation* operation, AFCalendar* calendar) {
NSLog(@"Calendar: %@", calendar);
NSLog(@"Events: %@", calendar.events);
} failure:^(AFHTTPRequestOperation* operation, NSError* error) {
NSLog(@"Error: %@", error);
}]
[calendarClient enqueueHTTPRequestOperation:calendarOperation];
```## Use AFHTTPClient and use AFCalendarRequestOperation manually
``` objective-c
NSURL* calendareUrl = [NSURL URLWithString:@"https://www.google.com/calendar/ical/german__de%40holiday.calendar.google.com/public/basic.ics"];
NSURLRequest* calendarRequest = [NSURLRequest requestWithURL:calendarUrl];AFCalendarOperation* operation = [[AFCalendarOperation alloc] initWithRequest:calendarRequest];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation* operation, AFCalendar* calendar) {
NSLog(@"Calendar: %@", calendar);
NSLog(@"Events: %@", calendar.events);
} failure:^(AFHTTPRequestOperation* operation, NSError* error) {
NSLog(@"Error: %@", error);
}]AFHTTPClient* anyHttpClient = ...;
[anyHttpClient enqueueHTTPRequestOperation:calendarOperation];
```## Status
* General calendar parsing into a simple model, see AFCalendarModel.h
If you want read another calendar format please constribute it or add an issue for that.
* Parsing of different date formats into NSDate
* Unit tests for all classesOpen todos:
* Support for events in a sequence
* Implement comperator to simple sort the events## How to constribute
* Clone or fork the project with AFNetworking as submodule.
* Fix or extend the code with the contain test classes.
* Add your commit under MIT license to an issue or pull request.git clone --recursive [email protected]:jerolimov/AFCalendarRequestOperation.git
## License
AFCalendarRequestOperation extension is available under the MIT license,
like [AFNetworking](https://github.com/AFNetworking/AFNetworking) itself.
Read the LICENSE.txt file for more details.