muni 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CNAME +1 -0
- data/LICENSE +7 -0
- data/README.md +41 -1
- data/bin/muni +12 -10
- data/lib/muni/direction.rb +1 -0
- data/lib/muni/route.rb +5 -0
- data/lib/muni/version.rb +1 -1
- data/man/index.html +73 -0
- data/man/muni.1 +161 -0
- data/man/muni.1.html +178 -0
- data/man/muni.1.ronn +95 -0
- metadata +19 -13
data/CNAME
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
muni.jeffremer.com
|
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2011 Jeff Remer
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1 +1,41 @@
|
|
1
|
-
|
1
|
+
About
|
2
|
+
======
|
3
|
+
|
4
|
+
`muni` is a simple NextBus API Client library and command line tool for retrieving
|
5
|
+
San Francisco Muni bus route and stop prediction information.
|
6
|
+
|
7
|
+
Client Library
|
8
|
+
===============
|
9
|
+
|
10
|
+
Usage
|
11
|
+
------
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
# Find all routes.
|
15
|
+
Muni::Route.find(:all)
|
16
|
+
# => [<Muni::Route tag="F" title="F-Market & Wharves">, ...]
|
17
|
+
|
18
|
+
# Find a specific route
|
19
|
+
r21 = Muni::Route.find(21)
|
20
|
+
# => <Muni::Route directions=[<Muni::Direction id="21_IB1" name="Inbound to Steuart Terminal" ...
|
21
|
+
|
22
|
+
# Get a prediction
|
23
|
+
r21.outbound.stop_at("Hayes and Laguna").predictions
|
24
|
+
# => [<Muni::Prediction block="2108" delayed="true" dirTag="21_OB4" epochTime="1306877956823" isDeparture="false" minutes="3" seconds="198" ...
|
25
|
+
```
|
26
|
+
|
27
|
+
CLI
|
28
|
+
====
|
29
|
+
|
30
|
+
`muni` includes a basic command-line interface, mostly as example usage of the client library. See `bin/muni`.
|
31
|
+
|
32
|
+
Usage
|
33
|
+
------
|
34
|
+
|
35
|
+
```bash
|
36
|
+
Tasks:
|
37
|
+
muni help [TASK] # Describe available tasks or one specific task
|
38
|
+
muni list # Lists all routes
|
39
|
+
muni predict [ROUTE] [DIRECTION] [STOP] # Retrieve predictions for a route at a specific stop
|
40
|
+
muni show [ROUTE_TAG] [DIRECTION] # Shows a specifc route by name
|
41
|
+
```
|
data/bin/muni
CHANGED
@@ -17,7 +17,7 @@ class MUNI < Thor
|
|
17
17
|
end
|
18
18
|
|
19
19
|
desc "show [ROUTE_TAG] [DIRECTION]", "Shows a specifc route by name"
|
20
|
-
|
20
|
+
method_option :verbose, :type => :boolean, :aliases => %w(-v --verbose)
|
21
21
|
def show(tag, direction = nil)
|
22
22
|
begin
|
23
23
|
route = Muni::Route.find(tag)
|
@@ -40,22 +40,24 @@ class MUNI < Thor
|
|
40
40
|
# having to quote the stop name.
|
41
41
|
stop = stop.join(' ')
|
42
42
|
|
43
|
+
if stop.empty?
|
44
|
+
say_status "ERROR", "A stop is required", :red
|
45
|
+
exit!
|
46
|
+
end
|
47
|
+
|
43
48
|
# Get the bus route information
|
44
49
|
# TODO Only do this if necessary
|
45
50
|
bus = Muni::Route.find(route)
|
46
51
|
|
47
|
-
# Look up the
|
48
|
-
|
52
|
+
# Look up the directon information
|
53
|
+
direction = bus.direction_at(direction)
|
54
|
+
|
55
|
+
# Look up the stop information
|
56
|
+
stop = direction.stop_at(stop)
|
49
57
|
|
50
|
-
# Look up the direction information if using "inbound" or "outbound" instead
|
51
|
-
# of a direction tag.
|
52
|
-
direction = bus.send(direction.downcase.to_sym).id if direction =~ /(inbound|outbound)/i
|
53
|
-
|
54
|
-
# Create the stop object from the route, direction, and tag.
|
55
|
-
stop = Muni::Stop.new({:route_tag => route, :direction => direction, :tag => stop})
|
56
|
-
|
57
58
|
# Retrieve the predictions
|
58
59
|
begin
|
60
|
+
say "Route #{bus.title} going #{direction.name} at #{stop.title}:"
|
59
61
|
print_table stop.predictions.collect{|time| [time.vehicle, time.pretty_time]}, {:ident => 8}
|
60
62
|
rescue Muni::NextBusError => e
|
61
63
|
say_status "ERROR", e.message, :red
|
data/lib/muni/direction.rb
CHANGED
data/lib/muni/route.rb
CHANGED
@@ -6,6 +6,11 @@ require 'muni/direction'
|
|
6
6
|
|
7
7
|
module Muni
|
8
8
|
class Route < Base
|
9
|
+
def direction_at(direction)
|
10
|
+
return send(direction.downcase.to_sym) if direction =~ /(outbound|inbound)/i
|
11
|
+
directions.select{|dir| dir.id == direction}.first
|
12
|
+
end
|
13
|
+
|
9
14
|
def outbound
|
10
15
|
directions.select{|dir| dir.name =~ /outbound/i}.first
|
11
16
|
end
|
data/lib/muni/version.rb
CHANGED
data/man/index.html
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Muni</title>
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
font-size:24px;
|
8
|
+
line-height:1.5;
|
9
|
+
font-family:georgia,serif;
|
10
|
+
color:#555;
|
11
|
+
}
|
12
|
+
div#index {
|
13
|
+
width:28em;
|
14
|
+
margin:0 auto;
|
15
|
+
}
|
16
|
+
h1 {
|
17
|
+
text-align:center;
|
18
|
+
font-weight:normal;
|
19
|
+
color:#000;
|
20
|
+
margin-bottom:0;
|
21
|
+
letter-spacing:-3px;
|
22
|
+
}
|
23
|
+
h3 {
|
24
|
+
text-align:center;
|
25
|
+
font-weight:normal;
|
26
|
+
color:#444;
|
27
|
+
margin-top:-20px;
|
28
|
+
margin-bottom:40px;
|
29
|
+
}
|
30
|
+
h4 {
|
31
|
+
font-weight:normal;
|
32
|
+
font-size:26px;
|
33
|
+
color:#111;
|
34
|
+
}
|
35
|
+
p, dl { margin-left:40px }
|
36
|
+
.aux { font-family:monospace;font-size:20px;letter-spacing:1px; }
|
37
|
+
.also { font-size:18px }
|
38
|
+
.copy { font-size:16px;text-align:center;color:#111 }
|
39
|
+
.man-ref { font-family:monospace;letter-spacing:-2px; }
|
40
|
+
</style>
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
<div id='index'>
|
44
|
+
<h1>Muni</h1>
|
45
|
+
<h3>Bus information</h3>
|
46
|
+
|
47
|
+
<h4>Auxiliary</h4>
|
48
|
+
<p class='aux'>
|
49
|
+
<a href='https://github.com/jeffremer/muni#readme'>README</a>,
|
50
|
+
<a href='https://github.com/jeffremer/muni'>GITHUB</a>
|
51
|
+
<!--
|
52
|
+
<a href='http://github.com/rtomayko/ronn/blob/master/INSTALLING#files'>INSTALLING</a>,
|
53
|
+
<a href='http://github.com/rtomayko/ronn/blob/master/CHANGES#files'>CHANGES</a>,
|
54
|
+
<a href='http://github.com/rtomayko/ronn/blob/master/COPYING#files'>COPYING</a>,
|
55
|
+
<a href='http://github.com/rtomayko/ronn/blob/master/AUTHORS#files'>AUTHORS</a>
|
56
|
+
-->
|
57
|
+
</p>
|
58
|
+
|
59
|
+
<h4>Manuals</h4>
|
60
|
+
<dl>
|
61
|
+
<dt><a class='man-ref' href='muni.1.html'>muni(1)</a></dt>
|
62
|
+
<dd>muni route information and prediction tool</dd>
|
63
|
+
</dl>
|
64
|
+
|
65
|
+
<h4>See Also</h4>
|
66
|
+
<p class='also'>
|
67
|
+
<a class='man-ref' href="http://www.sfmta.com/cms/asite/nextmunidata.htm">Next Muni</a>
|
68
|
+
</p>
|
69
|
+
|
70
|
+
<p class='copy'>Copyright © 2011 Jeff Remer</p>
|
71
|
+
</div>
|
72
|
+
</body>
|
73
|
+
</html>
|
data/man/muni.1
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "MUNI" "1" "May 2011" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBmuni\fR \- show san francisco muni routes and stop predictions
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBmuni\fR \fBhelp\fR [TASK]
|
11
|
+
.
|
12
|
+
.br
|
13
|
+
\fBmuni\fR \fBlist\fR
|
14
|
+
.
|
15
|
+
.br
|
16
|
+
\fBmuni\fR \fBpredict\fR \fIroute\fR \fIdirection\fR \fIstop\fR
|
17
|
+
.
|
18
|
+
.br
|
19
|
+
\fBmuni\fR \fBshow\fR \fB\-v\fR|\fB\-\-verbose\fR \fIroute\fR [\fIdirection\fR]
|
20
|
+
.
|
21
|
+
.br
|
22
|
+
.
|
23
|
+
.SH "DESCRIPTION"
|
24
|
+
\fBmuni\fR retrieves San Francisco MUNI routes information and bus stop prediction times\. \fBmuni\fR is mostly an exercise in implementing the core functions of the \fBmuni\fR NextBus API client\.
|
25
|
+
.
|
26
|
+
.SH "EXAMPLES"
|
27
|
+
List all available routes:
|
28
|
+
.
|
29
|
+
.IP "" 4
|
30
|
+
.
|
31
|
+
.nf
|
32
|
+
|
33
|
+
$ muni list
|
34
|
+
F F\-Market & Wharves
|
35
|
+
J J\-Church
|
36
|
+
KT KT\-Ingleside/Third Street
|
37
|
+
L L\-Taraval
|
38
|
+
M M\-Ocean View
|
39
|
+
\.\.\.\.
|
40
|
+
.
|
41
|
+
.fi
|
42
|
+
.
|
43
|
+
.IP "" 0
|
44
|
+
.
|
45
|
+
.P
|
46
|
+
Show basic route information:
|
47
|
+
.
|
48
|
+
.IP "" 4
|
49
|
+
.
|
50
|
+
.nf
|
51
|
+
|
52
|
+
$ muni show 21
|
53
|
+
21 21\-Hayes
|
54
|
+
21_IB1 Inbound to Steuart Terminal
|
55
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
56
|
+
.
|
57
|
+
.fi
|
58
|
+
.
|
59
|
+
.IP "" 0
|
60
|
+
.
|
61
|
+
.P
|
62
|
+
Show a route and all stops using \fB\-v\fR or \fB\-\-verbose\fR:
|
63
|
+
.
|
64
|
+
.IP "" 4
|
65
|
+
.
|
66
|
+
.nf
|
67
|
+
|
68
|
+
$ muni show 21 \-\-verbose
|
69
|
+
21 21\-Hayes
|
70
|
+
21_IB1 Inbound to Steuart Terminal
|
71
|
+
7499 Fulton St & Shrader St
|
72
|
+
\.\.\.
|
73
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
74
|
+
6497 Steuart St & Mission St
|
75
|
+
6501 Steuart St & Market St
|
76
|
+
5669 Market St & Drumm St
|
77
|
+
\.\.\.
|
78
|
+
.
|
79
|
+
.fi
|
80
|
+
.
|
81
|
+
.IP "" 0
|
82
|
+
.
|
83
|
+
.P
|
84
|
+
Show a route and all stops for a particular direction:
|
85
|
+
.
|
86
|
+
.IP "" 4
|
87
|
+
.
|
88
|
+
.nf
|
89
|
+
|
90
|
+
$ muni show 21 outbound \-\-verbose
|
91
|
+
21 21\-Hayes
|
92
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
93
|
+
6497 Steuart St & Mission St
|
94
|
+
6501 Steuart St & Market St
|
95
|
+
5669 Market St & Drumm St
|
96
|
+
\.\.\.
|
97
|
+
.
|
98
|
+
.fi
|
99
|
+
.
|
100
|
+
.IP "" 0
|
101
|
+
.
|
102
|
+
.P
|
103
|
+
Get predictions for a bus, going a certain direction, at a given stop\. \fBpredict\fR can take the formal tag names for the direction and stop, or it will perform it\'s best guess\.
|
104
|
+
.
|
105
|
+
.P
|
106
|
+
With formal direction and stop tags:
|
107
|
+
.
|
108
|
+
.IP "" 4
|
109
|
+
.
|
110
|
+
.nf
|
111
|
+
|
112
|
+
$ muni predict 21 21_OB4 5008
|
113
|
+
Route 21\-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
114
|
+
2831 2 minutes
|
115
|
+
8189 16 minutes
|
116
|
+
8359 30 minutes
|
117
|
+
2842 40 minutes
|
118
|
+
2823 about 1 hour
|
119
|
+
.
|
120
|
+
.fi
|
121
|
+
.
|
122
|
+
.IP "" 0
|
123
|
+
.
|
124
|
+
.P
|
125
|
+
With a fuzzy stop name:
|
126
|
+
.
|
127
|
+
.IP "" 4
|
128
|
+
.
|
129
|
+
.nf
|
130
|
+
|
131
|
+
$ muni predict 21 21_OB4 hayes and shrader
|
132
|
+
Route 21\-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
133
|
+
2831 2 minutes
|
134
|
+
8189 16 minutes
|
135
|
+
8359 30 minutes
|
136
|
+
2842 40 minutes
|
137
|
+
2823 about 1 hour
|
138
|
+
.
|
139
|
+
.fi
|
140
|
+
.
|
141
|
+
.IP "" 0
|
142
|
+
.
|
143
|
+
.P
|
144
|
+
With a fuzzy direction and stop name:
|
145
|
+
.
|
146
|
+
.IP "" 4
|
147
|
+
.
|
148
|
+
.nf
|
149
|
+
|
150
|
+
$ muni predict 21 inbound hayes and shrader
|
151
|
+
Route 21\-Hayes going Inbound to Steuart Terminal at Hayes St & Shrader St:
|
152
|
+
8102 less than a minute
|
153
|
+
2832 2 minutes
|
154
|
+
2831 22 minutes
|
155
|
+
8189 32 minutes
|
156
|
+
2842 about 1 hour
|
157
|
+
.
|
158
|
+
.fi
|
159
|
+
.
|
160
|
+
.IP "" 0
|
161
|
+
|
data/man/muni.1.html
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>muni(1) - show san francisco muni routes and stop predictions</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<ol class='man-decor man-head man head'>
|
63
|
+
<li class='tl'>muni(1)</li>
|
64
|
+
<li class='tc'></li>
|
65
|
+
<li class='tr'>muni(1)</li>
|
66
|
+
</ol>
|
67
|
+
|
68
|
+
<h2 id="NAME">NAME</h2>
|
69
|
+
<p class="man-name">
|
70
|
+
<code>muni</code> - <span class="man-whatis">show san francisco muni routes and stop predictions</span>
|
71
|
+
</p>
|
72
|
+
|
73
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
74
|
+
|
75
|
+
<p><code>muni</code> <code>help</code> [TASK]<br />
|
76
|
+
<code>muni</code> <code>list</code><br />
|
77
|
+
<code>muni</code> <code>predict</code> <var>route</var> <var>direction</var> <var>stop</var><br />
|
78
|
+
<code>muni</code> <code>show</code> <code>-v</code>|<code>--verbose</code> <var>route</var> [<var>direction</var>]<br /></p>
|
79
|
+
|
80
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
81
|
+
|
82
|
+
<p><strong>muni</strong> retrieves San Francisco MUNI routes information and bus stop prediction
|
83
|
+
times. <code>muni</code> is mostly an exercise in implementing the core functions of the <code>muni</code>
|
84
|
+
NextBus API client.</p>
|
85
|
+
|
86
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
87
|
+
|
88
|
+
<p>List all available routes:</p>
|
89
|
+
|
90
|
+
<pre><code>$ muni list
|
91
|
+
F F-Market & Wharves
|
92
|
+
J J-Church
|
93
|
+
KT KT-Ingleside/Third Street
|
94
|
+
L L-Taraval
|
95
|
+
M M-Ocean View
|
96
|
+
....
|
97
|
+
</code></pre>
|
98
|
+
|
99
|
+
<p>Show basic route information:</p>
|
100
|
+
|
101
|
+
<pre><code>$ muni show 21
|
102
|
+
21 21-Hayes
|
103
|
+
21_IB1 Inbound to Steuart Terminal
|
104
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
105
|
+
</code></pre>
|
106
|
+
|
107
|
+
<p>Show a route and all stops using <code>-v</code> or <code>--verbose</code>:</p>
|
108
|
+
|
109
|
+
<pre><code>$ muni show 21 --verbose
|
110
|
+
21 21-Hayes
|
111
|
+
21_IB1 Inbound to Steuart Terminal
|
112
|
+
7499 Fulton St & Shrader St
|
113
|
+
...
|
114
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
115
|
+
6497 Steuart St & Mission St
|
116
|
+
6501 Steuart St & Market St
|
117
|
+
5669 Market St & Drumm St
|
118
|
+
...
|
119
|
+
</code></pre>
|
120
|
+
|
121
|
+
<p>Show a route and all stops for a particular direction:</p>
|
122
|
+
|
123
|
+
<pre><code>$ muni show 21 outbound --verbose
|
124
|
+
21 21-Hayes
|
125
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
126
|
+
6497 Steuart St & Mission St
|
127
|
+
6501 Steuart St & Market St
|
128
|
+
5669 Market St & Drumm St
|
129
|
+
...
|
130
|
+
</code></pre>
|
131
|
+
|
132
|
+
<p>Get predictions for a bus, going a certain direction, at a given stop.
|
133
|
+
<code>predict</code> can take the formal tag names for the direction and stop, or
|
134
|
+
it will perform it's best guess.</p>
|
135
|
+
|
136
|
+
<p>With formal direction and stop tags:</p>
|
137
|
+
|
138
|
+
<pre><code>$ muni predict 21 21_OB4 5008
|
139
|
+
Route 21-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
140
|
+
2831 2 minutes
|
141
|
+
8189 16 minutes
|
142
|
+
8359 30 minutes
|
143
|
+
2842 40 minutes
|
144
|
+
2823 about 1 hour
|
145
|
+
</code></pre>
|
146
|
+
|
147
|
+
<p>With a fuzzy stop name:</p>
|
148
|
+
|
149
|
+
<pre><code>$ muni predict 21 21_OB4 hayes and shrader
|
150
|
+
Route 21-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
151
|
+
2831 2 minutes
|
152
|
+
8189 16 minutes
|
153
|
+
8359 30 minutes
|
154
|
+
2842 40 minutes
|
155
|
+
2823 about 1 hour
|
156
|
+
</code></pre>
|
157
|
+
|
158
|
+
<p>With a fuzzy direction and stop name:</p>
|
159
|
+
|
160
|
+
<pre><code>$ muni predict 21 inbound hayes and shrader
|
161
|
+
Route 21-Hayes going Inbound to Steuart Terminal at Hayes St & Shrader St:
|
162
|
+
8102 less than a minute
|
163
|
+
2832 2 minutes
|
164
|
+
2831 22 minutes
|
165
|
+
8189 32 minutes
|
166
|
+
2842 about 1 hour
|
167
|
+
</code></pre>
|
168
|
+
|
169
|
+
|
170
|
+
<ol class='man-decor man-foot man foot'>
|
171
|
+
<li class='tl'></li>
|
172
|
+
<li class='tc'>May 2011</li>
|
173
|
+
<li class='tr'>muni(1)</li>
|
174
|
+
</ol>
|
175
|
+
|
176
|
+
</div>
|
177
|
+
</body>
|
178
|
+
</html>
|
data/man/muni.1.ronn
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
muni(1) -- show san francisco muni routes and stop predictions
|
2
|
+
================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`muni` `help` [TASK]<br/>
|
7
|
+
`muni` `list`<br/>
|
8
|
+
`muni` `predict` <route> <direction> <stop><br/>
|
9
|
+
`muni` `show` `-v`|`--verbose` <route> [<direction>]<br/>
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
**muni** retrieves San Francisco MUNI routes information and bus stop prediction
|
14
|
+
times. `muni` is mostly an exercise in implementing the core functions of the `muni`
|
15
|
+
NextBus API client.
|
16
|
+
|
17
|
+
## EXAMPLES
|
18
|
+
|
19
|
+
List all available routes:
|
20
|
+
|
21
|
+
$ muni list
|
22
|
+
F F-Market & Wharves
|
23
|
+
J J-Church
|
24
|
+
KT KT-Ingleside/Third Street
|
25
|
+
L L-Taraval
|
26
|
+
M M-Ocean View
|
27
|
+
....
|
28
|
+
|
29
|
+
Show basic route information:
|
30
|
+
|
31
|
+
$ muni show 21
|
32
|
+
21 21-Hayes
|
33
|
+
21_IB1 Inbound to Steuart Terminal
|
34
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
35
|
+
|
36
|
+
Show a route and all stops using `-v` or `--verbose`:
|
37
|
+
|
38
|
+
$ muni show 21 --verbose
|
39
|
+
21 21-Hayes
|
40
|
+
21_IB1 Inbound to Steuart Terminal
|
41
|
+
7499 Fulton St & Shrader St
|
42
|
+
...
|
43
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
44
|
+
6497 Steuart St & Mission St
|
45
|
+
6501 Steuart St & Market St
|
46
|
+
5669 Market St & Drumm St
|
47
|
+
...
|
48
|
+
|
49
|
+
Show a route and all stops for a particular direction:
|
50
|
+
|
51
|
+
$ muni show 21 outbound --verbose
|
52
|
+
21 21-Hayes
|
53
|
+
21_OB4 Outbound to Fulton St & Shrader St
|
54
|
+
6497 Steuart St & Mission St
|
55
|
+
6501 Steuart St & Market St
|
56
|
+
5669 Market St & Drumm St
|
57
|
+
...
|
58
|
+
|
59
|
+
Get predictions for a bus, going a certain direction, at a given stop.
|
60
|
+
`predict` can take the formal tag names for the direction and stop, or
|
61
|
+
it will perform it's best guess.
|
62
|
+
|
63
|
+
With formal direction and stop tags:
|
64
|
+
|
65
|
+
$ muni predict 21 21_OB4 5008
|
66
|
+
Route 21-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
67
|
+
2831 2 minutes
|
68
|
+
8189 16 minutes
|
69
|
+
8359 30 minutes
|
70
|
+
2842 40 minutes
|
71
|
+
2823 about 1 hour
|
72
|
+
|
73
|
+
With a fuzzy stop name:
|
74
|
+
|
75
|
+
$ muni predict 21 21_OB4 hayes and shrader
|
76
|
+
Route 21-Hayes going Outbound to Fulton St & Shrader St at Hayes St & Shrader St:
|
77
|
+
2831 2 minutes
|
78
|
+
8189 16 minutes
|
79
|
+
8359 30 minutes
|
80
|
+
2842 40 minutes
|
81
|
+
2823 about 1 hour
|
82
|
+
|
83
|
+
With a fuzzy direction and stop name:
|
84
|
+
|
85
|
+
$ muni predict 21 inbound hayes and shrader
|
86
|
+
Route 21-Hayes going Inbound to Steuart Terminal at Hayes St & Shrader St:
|
87
|
+
8102 less than a minute
|
88
|
+
2832 2 minutes
|
89
|
+
2831 22 minutes
|
90
|
+
8189 32 minutes
|
91
|
+
2842 about 1 hour
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mash
|
17
|
-
requirement: &
|
17
|
+
requirement: &2152483680 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2152483680
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: xml-simple
|
28
|
-
requirement: &
|
28
|
+
requirement: &2152483140 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2152483140
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: actionpack
|
39
|
-
requirement: &
|
39
|
+
requirement: &2152482660 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2152482660
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: amatch
|
50
|
-
requirement: &
|
50
|
+
requirement: &2152482200 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2152482200
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: thor
|
61
|
-
requirement: &
|
61
|
+
requirement: &2152481680 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2152481680
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
|
-
requirement: &
|
72
|
+
requirement: &2152481080 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: 2.0.0.beta.22
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2152481080
|
81
81
|
description: A simple NextBus API client for retrieving San Francisco Muni bus route
|
82
82
|
and stop prediction information
|
83
83
|
email:
|
@@ -88,7 +88,9 @@ extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
90
|
- .gitignore
|
91
|
+
- CNAME
|
91
92
|
- Gemfile
|
93
|
+
- LICENSE
|
92
94
|
- README.md
|
93
95
|
- Rakefile
|
94
96
|
- bin/muni
|
@@ -99,6 +101,10 @@ files:
|
|
99
101
|
- lib/muni/route.rb
|
100
102
|
- lib/muni/stop.rb
|
101
103
|
- lib/muni/version.rb
|
104
|
+
- man/index.html
|
105
|
+
- man/muni.1
|
106
|
+
- man/muni.1.html
|
107
|
+
- man/muni.1.ronn
|
102
108
|
- muni.gemspec
|
103
109
|
- spec/route_spec.rb
|
104
110
|
- spec/stop_spec.rb
|