GithubHelp home page GithubHelp logo

kiliankoe / dvb Goto Github PK

View Code? Open in Web Editor NEW
22.0 5.0 2.0 1.53 MB

🚆 Query Dresden's public transport system for current bus- and tramstop data in swift

Home Page: https://kiliankoe.github.io/DVB

License: MIT License

Ruby 1.03% Swift 98.74% Makefile 0.23%
dvb vvo dresden public-transportation

dvb's Introduction

🚆DVB

Travis Version Platform Docs

This is an unofficial Swift package giving you a few options to query Dresden's public transport system for current bus- and tramstop data.

Want something like this for another language, look no further 🙂

Example

Have a look at the example iOS app.

Installation

DVB is available through Cocoapods, Carthage/Punic and Swift Package Manager, whatever floats your boat.

// Cocoapods
pod 'DVB'

// Carthage
github "kiliankoe/DVB"

// Swift Package Manager
.package(url: "https://github.com/kiliankoe/DVB", from: "latest_version")

Quick Start

Be sure to check the docs for more detailed information on how to use this library, but here are some quick examples for getting started right away.

Caveat: Stops are always represented by their ID. You can get a stop's ID via Stop.find(). Some of the methods listed below offer convenience overloads, which are listed here since they look nicer. The downside to these is that they have to send of a find request for every stop first resulting in a significant overhead. Should you already have a stop's ID at hand I strongly suggest you use that instead.

Monitor a single stop

Monitor a single stop to see every bus, tram or whatever leaving this stop. The necessary stop id can be found by using the find() function.

// See caveat above
Departure.monitor(stopWithName: "Postplatz") { result in
    guard let response = result.success else { return }
    print(response.departures)
}

Find a specific stop

Say you're looking for "Helmholtzstraße". You can use the following to find a list of matches.

Stop.find("Helmholtzstraße") { result in
    guard let response = result.success else { return }
    print(response.stops)
}

You can also get a list of stops around a given coordinate.

let coordinate = CLLocationCoordinate2D(latitude: 51.063080, longitude: 13.736835)
Stop.findNear(coordinate) { result in
    guard let response = result.success else { return }
    print(response.stops)
}

Find a route from A to B

Want to go somewhere?

// See caveat above
Trip.find(from: "Albertplatz", to: "Hauptbahnhof") { result in
    guard let response = result.success else { return }
    print(response.routes)
}

Look up current route changes

Want to see if your favorite lines are currently being re-routed due to construction or some other reason? Check the published list of route changes.

RouteChange.get { result in
    guard let response = result.success else { return }
    print(response.lines)
    print(response.changes)
}

Lines running at a specific stop

Looking to find which lines service a specific stop? There's a func for that.

// See caveat above
Line.get(forStopName: "Postplatz") { result in
    guard let response = result.success else { return }
    print(response.lines)
}

Authors

Kilian Koeltzsch, @kiliankoe

Max Kattner, @maxkattner

License

DVB is available under the MIT license. See the LICENSE file for more info.

Terms of Service

Please refer to the VVO Terms of Service regarding their widget. Take particular care not to use this library to hammer their servers through too many requests to their graciously-provided API.

dvb's People

Contributors

h4llow3en avatar kiliankoe avatar marcusrossel avatar maxkattner avatar philippmatthes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dvb's Issues

Fix failing `pod lib lint`

Currently preventing travis from succeeding. It's failing on building Kanna for me. No clue why, Xcode builds everything just fine. Output makes it seem like it's building an old version of Kanna?

My output:

 -> DVB (1.0.0)
    - ERROR | xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:38:32: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:87:25: warning: extraneous '_' in parameter: 'pattern' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:139:40: warning: extraneous '_' in parameter: 'result' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:149:32: error: 'inout' must appear before the parameter name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:149:25: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:171:32: error: 'inout' must appear before the parameter name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:171:25: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:188:34: error: 'inout' must appear before the parameter name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:188:27: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:292:32: error: 'inout' must appear before the parameter name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:292:25: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:311:35: error: 'inout' must appear before the parameter name
    - WARN  | xcodebuild:  Kanna/Sources/CSS.swift:311:28: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:190:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:190:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:31:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:31:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:32:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:32:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:33:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:33:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:34:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:34:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:35:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:35:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:158:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:158:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:159:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:159:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:160:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:160:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:161:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:161:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:162:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:162:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:107:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:107:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:108:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:108:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:109:5: error: expected declaration
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:109:16: error: consecutive declarations on a line must be separated by ';'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:48:28: error: value of type 'NSString' has no member 'substring'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:52:38: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:55:41: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:60:43: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:65:42: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:91:77: error: type 'NSRegularExpressionOptions' has no member 'caseInsensitive'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:118:15: error: extraneous argument label 'prefix:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:122:15: error: extraneous argument label 'prefix:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:141:21: error: value of type 'NSTextCheckingResult' has no member 'rangeAt'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:155:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:176:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:194:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:216:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:223:37: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:228:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:257:35: error: missing argument label 'b:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:259:35: error: missing argument label 'b:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:261:35: error: missing argument label 'b:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:271:31: error: missing argument label 'b:' in call
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:296:17: error: cannot assign to value: 'str' is a 'let' constant
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:299:36: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:302:29: error: value of type 'NSString' has no member 'substring'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:304:41: error: '&' used with non-inout argument of type 'String'
    - ERROR | xcodebuild:  Kanna/Sources/CSS.swift:315:17: error: cannot assign to value: 'str' is a 'let' constant
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:130:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:131:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:132:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:133:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:140:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:141:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:142:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:143:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:166:25: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:167:25: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:168:22: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/Kanna.swift:237:20: warning: extraneous '_' in parameter: 'index' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/libxmlParserOption.swift:57:40: error: use of undeclared type 'OptionSet'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlParserOption.swift:30:42: error: use of undeclared type 'OptionSet'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:36:70: error: contextual type 'Libxml2XMLParserOptions' cannot be used with array literal
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:37:71: error: contextual type 'Libxml2HTMLParserOptions' cannot be used with array literal
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:47:61: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:56:47: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:61:22: error: use of undeclared type 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:61:59: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:68:22: error: use of undeclared type 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:68:45: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:73:22: error: use of undeclared type 'URL'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:73:44: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:88:63: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:97:49: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:102:24: error: use of undeclared type 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:102:61: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:109:24: error: use of undeclared type 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:109:47: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:114:23: error: use of undeclared type 'URL'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:114:45: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:250:23: error: use of undeclared type 'Sequence'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:251:33: error: use of undeclared type 'AnyIterator'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:367:24: error: use of undeclared type 'Sequence'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:368:33: error: use of undeclared type 'AnyIterator'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:74:24: error: use of unresolved identifier 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:115:24: error: use of unresolved identifier 'Data'
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:282:41: error: cannot use optional chaining on non-optional value of type 'xmlNodeSetPtr' (aka 'UnsafeMutablePointer<_xmlNodeSet>')
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:288:36: error: cannot use optional chaining on non-optional value of type 'xmlNodeSetPtr' (aka 'UnsafeMutablePointer<_xmlNodeSet>')
    - ERROR | xcodebuild:  Kanna/Sources/Kanna.swift:302:29: error: use of unresolved identifier 'UnsafeRawPointer'
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:121:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:125:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:129:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:133:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:137:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:141:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:145:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:149:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:244:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:248:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:252:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:256:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:260:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:264:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:268:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:272:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:35:38: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:93:56: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:162:38: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:220:55: error: 'Encoding' is not a member type of 'String'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:48:45: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:49:26: error: incorrect argument label in call (have 'cString:', expected 'UTF8String:')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:60:26: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:61:26: error: incorrect argument label in call (have 'cString:', expected 'UTF8String:')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:114:25: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:175:45: error: value of optional type 'xmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:176:26: error: incorrect argument label in call (have 'cString:', expected 'UTF8String:')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:187:26: error: value of optional type 'xmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:188:26: error: incorrect argument label in call (have 'cString:', expected 'UTF8String:')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:241:25: error: value of optional type 'xmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:57:21: error: value of optional type 'UnsafeMutablePointer<xmlChar>?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLDocument.swift:184:21: error: value of optional type 'UnsafeMutablePointer<xmlChar>?' not unwrapped; did you mean to use '!' or '?'?
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:149:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:174:16: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:178:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:182:19: warning: extraneous '_' in parameter: 'xpath' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:186:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:197:14: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:201:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:205:17: warning: extraneous '_' in parameter: 'selector' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:209:25: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:216:25: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:223:19: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:231:22: warning: extraneous '_' in parameter: 'node' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:241:35: warning: extraneous '_' in parameter: 'nodePtr' has no keyword argument name
    - WARN  | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:257:21: warning: extraneous '_' in parameter: 'str' has no keyword argument name
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:40:27: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:40:35: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:41:54: error: cannot use optional chaining on non-optional value of type 'xmlBufferPtr' (aka 'UnsafeMutablePointer<_xmlBuffer>')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:48:26: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:48:34: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:49:54: error: cannot use optional chaining on non-optional value of type 'xmlBufferPtr' (aka 'UnsafeMutablePointer<_xmlBuffer>')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:56:25: error: value of type 'String' has no member 'replacingOccurrences'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:70:62: error: value of type 'xmlNodePtr' (aka 'UnsafeMutablePointer<_xmlNode>') has no member 'pointee'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:77:32: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:90:35: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:97:66: error: value of type 'xmlNodePtr' (aka 'UnsafeMutablePointer<_xmlNode>') has no member 'pointee'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:115:31: error: value of type 'xmlNodePtr' (aka 'UnsafeMutablePointer<_xmlNode>') has no member 'pointee'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:118:57: error: use of unresolved identifier 'UnsafeRawPointer'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:130:28: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:132:30: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:150:39: error: value of optional type 'htmlDocPtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:213:27: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:213:41: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:220:27: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:220:41: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:227:28: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:228:21: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:228:35: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:236:28: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:237:22: error: value of optional type 'xmlNodePtr?' not unwrapped; did you mean to use '!' or '?'?
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:243:45: error: use of unresolved identifier 'UnsafeRawPointer'
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:244:16: error: cannot use optional chaining on non-optional value of type 'UnsafeMutablePointer<xmlChar>' (aka 'UnsafeMutablePointer<UInt8>')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:247:12: error: cannot use optional chaining on non-optional value of type 'UnsafeMutablePointer<xmlChar>' (aka 'UnsafeMutablePointer<UInt8>')
    - ERROR | xcodebuild:  Kanna/Sources/libxmlHTMLNode.swift:260:18: error: value of type 'String' has no member 'replacingOccurrences'

Linux support

Not the most important of goals, but definitely something to explore. Would be very cool to have. Probably doesn't work out of the box 😜

Server only accepts GK4 coordinates

The server doesn't seem to be wanting to accept a coordinate converted from WGS84 to GK4 internally. Ugh.

curl -X "POST" "https://webapi.vvo-online.de/tr/pointfinder?format=json" \
     -H "Content-Type: application/json;charset=UTF-8" \
     -d $'{
  "limit": 0,
  "assignedstops": true,
  "query": "coord:5412867:5659752" # should be Albertplatz
}'
{
  "PointStatus": "NotIdentified",
  "Status": {
    "Code": "ServiceError",
    "Message": "no it connection"
  }
}

vs.

curl -X "POST" "https://webapi.vvo-online.de/tr/pointfinder?format=json" \
     -H "Content-Type: application/json;charset=UTF-8" \
     -d $'{
  "limit": 0,
  "assignedstops": true,
  "query": "coord:4621016:5655920" # should be Helmholtzstraße
}'
{
  "PointStatus": "Identified",
  "Status": {
    "Code": "Ok"
  },
  "Points": [
    "coord:4621020:504065:NAV4:Nöthnitzer Straße 46|c||Nöthnitzer Straße 46|5655935|4621020|0||",
    "33000742|||Helmholtzstraße|5655904|4621157|141||",
    "33000513|||Regensburger Straße|5655983|4620849|177||",
    "33000135|||Plauen Nöthnitzer Straße|5656060|4620527|507||",
    "33000134|||Münchner Platz|5656372|4620892|539||"
  ],
  "ExpirationTime": "\/Date(1488000580778+0100)\/"
}

Date string conversion

There were some changes regarding the parsing of the API's datestrings, but the tests for back-and-forth conversion now no longer pass. I'm guessing it's a timezone issue? Investigate this.

Support SPM

Just move all code to ./Sources, tests to ./Tests and add a minimal Package.swift. I think.

Migrate to WebAPI

Since EFA is going to be shut down at some point in the rather near future, it seems like a good idea to use the chance to migrate to use the WebAPI instead and also replace the widgets endpoint while at it.

Big upside is a whole bunch of new data being supplied by the WebAPI.

Check date conversion

The API seems to know about changes in daylight savings time, so they don't seem completely agnostic to timezones, but rather "just" an hour off. This will probably require a change in the date conversion code.

SwiftPM Package Resolution Failure

Currently failing with the following.

The package dependency graph can not be resolved; unable find any available tag for the following requirements:

App release

Hi Kilian, if VVO is approving my App, then I'd like to publish it to the iOS App Store. Before I submit my App, I wanted to seek for approval from you. Can I use your API as a part of my App? The App will be free. I would like to mention you in the App description with the following sentence:

Die Manni App nutzt mit freundlicher Genehmigung das VVO-Widget und die unter MIT Lizenz stehende API von Kilian Koeltzsch:
https://github.com/kiliankoe/DVB

Is this ok?

Convert coordinates

Everything regarding coordinates is currently broken, since the new API goes back to using the ridiculous internal coordinate format. This can probably be converted using the pod proj4, but it'd be much cleaner to see if there are ways to let the API handle the conversion instead.

Improve type parsing

Spent some time with @dirkonet's help on this yesterday. The results should cover most cases ('cept some very weird and very few edge ones, screw those :D), see here.

Error mapping

The API can throw errors (on wrong stop IDs for example). Unfortunately the status code remains at 200. The error is currently not mapped to anything and ignored. And unfortunately it seems as if the lib just hangs at that point o.O

Documentation

I threw out the previous documentation with 2.0.0, since it either no longer applied, was outdated or just ridiculous^^

Would be nice to bring most of that back in going forward.

Unknown mode of transport 'plusbus'.

Running

RouteChange.get { result in
    if let response = result.success {
        print(response.lines)
        print(response.changes)
    }
}

currently results in this message:

Unknown mode of transport 'plusbus', please open an issue on https://github.com/kiliankoe/DVB for this, thanks!

Project structure

Just re-generate with SPM and be done with it, the different targets for different platforms are completely unnecessary afaict. Cocoapods just needs an additional podspec and Carthage the xcodeproj (and Cartfile for further dependencies).

Rename project

I'm really starting to dislike this project's name, something like VVO.swift would be much more on point (regarding the data source) and easier to adopt for the other libraries.

What would a rename break?

  • Cocoapods?
  • Dependants through SPM/Carthage
    • probably safe (at least for a short time) thanks to a GitHub redirect?
  • source thanks to at least import VVO instead of import DVB?

Make Route.RouteStop conform to Protocol Hashable

I used the following code in an extension, which worked:

public var hashValue: Int {
        return self.name.hashValue
}
    
public static func ==(lhs: Route.RouteStop, rhs: Route.RouteStop) -> Bool {
        return lhs.name == rhs.name
}

Unfortunately, I will not send a pull request from my forked repo as it contains some further changes specifically for my App.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.