Latest | 1.0.0 |
---|---|
Homepage | https://github.com/artemyarulin/Kaare-Platform |
License | MIT |
Platforms | ios 7.0, requires ARC |
Dependencies | ReactiveCocoa, GDataXML-HTML, Kaare |
Frameworks | JavaScriptCore |
Authors |
Kaare wrappers around native platform API
Functionality
httpRequest(url,[requestOptions]) -> Rx.Observable
Kaare.platform.httpRequest(url,{method:'POST',body:'Hello=world'}).subscribe(
function(response) { console.log(response.statusCode, response.body) },
function(error) { console.error(error) },
function() { console.log('Done') })
xPath(documentString,xpathQuery,isHTML) -> Rx.Observable
Kaare.platform.xPath(doc,xpath,[true]).subscribe(
function(foundOccurrence) { console.log(foundOccurrence) },
function(error) { console.error(error) },
function() { console.log('Done') })
Both API combined:
Kaare.platform.httpRequest('http://google.com')
.map(function(response) { return response.body })
.map(function(body) { return Kaare.platform.xPath(body,'//input/@value') })
.map(function(inputValue) { return 'Found name with value: ' + inputValue })
.subscribe(function(logEntry) { console.log(logEntry) })
Latest podspec
{ "name": "Kaare-Platform", "version": "1.0.0", "summary": "Kaare extensions which provides access to native OS functionality like: HttpRequest and XPath", "description": "Provides wrappers around native functions for iOS which you can use through Kaare from your JavaScript logic", "homepage": "https://github.com/artemyarulin/Kaare-Platform", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Artem Yarulin": "[email protected]" }, "platforms": { "ios": "7.0" }, "source": { "git": "https://github.com/artemyarulin/Kaare-Platform.git", "tag": "1.0.0" }, "source_files": [ "iOS/Kaare-Platform/KaarePlatform.{h,m}", "iOS/Kaare-Platform/Modules/*.{h,m}" ], "resource_bundles": { "KaarePlatform": [ "js/build/kaare.platform.js" ] }, "public_header_files": "iOS/Kaare-Platform/KaarePlatform.h", "frameworks": "JavaScriptCore", "requires_arc": true, "dependencies": { "ReactiveCocoa": [ "~> 2.3.1" ], "GDataXML-HTML": [ "~> 1.1" ], "Kaare": [ "~> 1.0.0" ] }, "libraries": "xml2", "xcconfig": { "HEADER_SEARCH_PATHS": "$(SDKROOT)/usr/include/libxml2" } }
Sun, 28 Feb 2016 19:37:03 +0000